Upload project.

This commit is contained in:
StevenJW
2020-06-09 21:21:37 +01:00
parent 251cec2dac
commit 15556e92aa
196 changed files with 86759 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
[Migration("20191205144118_InitialCreate")]
partial class InitialCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,70 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Stock.Data.Migrations
{
public partial class InitialCreate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Prices",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
ProductStockId = table.Column<int>(nullable: false),
ProductPrice = table.Column<double>(nullable: false),
Date = table.Column<DateTime>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Prices", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ProductStocks",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
ProductId = table.Column<int>(nullable: false),
Stock = table.Column<int>(nullable: false),
PriceId = table.Column<int>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ProductStocks", x => x.Id);
});
migrationBuilder.InsertData(
table: "Prices",
columns: new[] { "Id", "Date", "ProductPrice", "ProductStockId" },
values: new object[,]
{
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 9.9900000000000002, 1 },
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 8.9900000000000002, 1 },
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 17.989999999999998, 2 }
});
migrationBuilder.InsertData(
table: "ProductStocks",
columns: new[] { "Id", "PriceId", "ProductId", "Stock" },
values: new object[,]
{
{ 1, 2, 1, 4 },
{ 2, 3, 2, 42 }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Prices");
migrationBuilder.DropTable(
name: "ProductStocks");
}
}
}

View File

@@ -0,0 +1,169 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
[Migration("20191218210759_TestDataProducts")]
partial class TestDataProducts
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
},
new
{
Id = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 23.0,
ProductStockId = 3
},
new
{
Id = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 2.9900000000000002,
ProductStockId = 4
},
new
{
Id = 6,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 49.630000000000003,
ProductStockId = 5
},
new
{
Id = 7,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 4.5599999999999996,
ProductStockId = 6
},
new
{
Id = 8,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 10.01,
ProductStockId = 7
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
},
new
{
Id = 3,
PriceId = 4,
ProductId = 3,
Stock = 32
},
new
{
Id = 4,
PriceId = 5,
ProductId = 4,
Stock = 13
},
new
{
Id = 5,
PriceId = 6,
ProductId = 5,
Stock = 0
},
new
{
Id = 6,
PriceId = 7,
ProductId = 6,
Stock = 1
},
new
{
Id = 7,
PriceId = 8,
ProductId = 7,
Stock = 49
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,88 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Stock.Data.Migrations
{
public partial class TestDataProducts : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "Prices",
columns: new[] { "Id", "Date", "ProductPrice", "ProductStockId" },
values: new object[,]
{
{ 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 23.0, 3 },
{ 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 2.9900000000000002, 4 },
{ 6, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 49.630000000000003, 5 },
{ 7, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 4.5599999999999996, 6 },
{ 8, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 10.01, 7 }
});
migrationBuilder.InsertData(
table: "ProductStocks",
columns: new[] { "Id", "PriceId", "ProductId", "Stock" },
values: new object[,]
{
{ 3, 4, 3, 32 },
{ 4, 5, 4, 13 },
{ 5, 6, 5, 0 },
{ 6, 7, 6, 1 },
{ 7, 8, 7, 49 }
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "Prices",
keyColumn: "Id",
keyValue: 4);
migrationBuilder.DeleteData(
table: "Prices",
keyColumn: "Id",
keyValue: 5);
migrationBuilder.DeleteData(
table: "Prices",
keyColumn: "Id",
keyValue: 6);
migrationBuilder.DeleteData(
table: "Prices",
keyColumn: "Id",
keyValue: 7);
migrationBuilder.DeleteData(
table: "Prices",
keyColumn: "Id",
keyValue: 8);
migrationBuilder.DeleteData(
table: "ProductStocks",
keyColumn: "Id",
keyValue: 3);
migrationBuilder.DeleteData(
table: "ProductStocks",
keyColumn: "Id",
keyValue: 4);
migrationBuilder.DeleteData(
table: "ProductStocks",
keyColumn: "Id",
keyValue: 5);
migrationBuilder.DeleteData(
table: "ProductStocks",
keyColumn: "Id",
keyValue: 6);
migrationBuilder.DeleteData(
table: "ProductStocks",
keyColumn: "Id",
keyValue: 7);
}
}
}

View File

@@ -0,0 +1,194 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
[Migration("20200102001637_AddBaseOrderRequests")]
partial class AddBaseOrderRequests
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<bool>("Approved");
b.Property<DateTime>("ApprovedTime");
b.Property<bool>("Deleted");
b.Property<double>("Price");
b.Property<int>("ProductId");
b.Property<int>("Quantity");
b.Property<DateTime>("SubmittedTime");
b.HasKey("Id");
b.ToTable("OrderRequests");
});
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
},
new
{
Id = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 23.0,
ProductStockId = 3
},
new
{
Id = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 2.9900000000000002,
ProductStockId = 4
},
new
{
Id = 6,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 49.630000000000003,
ProductStockId = 5
},
new
{
Id = 7,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 4.5599999999999996,
ProductStockId = 6
},
new
{
Id = 8,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 10.01,
ProductStockId = 7
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
},
new
{
Id = 3,
PriceId = 4,
ProductId = 3,
Stock = 32
},
new
{
Id = 4,
PriceId = 5,
ProductId = 4,
Stock = 13
},
new
{
Id = 5,
PriceId = 6,
ProductId = 5,
Stock = 0
},
new
{
Id = 6,
PriceId = 7,
ProductId = 6,
Stock = 1
},
new
{
Id = 7,
PriceId = 8,
ProductId = 7,
Stock = 49
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,37 @@
using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Stock.Data.Migrations
{
public partial class AddBaseOrderRequests : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OrderRequests",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
ProductId = table.Column<int>(nullable: false),
Quantity = table.Column<int>(nullable: false),
Price = table.Column<double>(nullable: false),
SubmittedTime = table.Column<DateTime>(nullable: false),
Approved = table.Column<bool>(nullable: false),
ApprovedTime = table.Column<DateTime>(nullable: false),
Deleted = table.Column<bool>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OrderRequests", x => x.Id);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OrderRequests");
}
}
}

View File

@@ -0,0 +1,194 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
[Migration("20200102011301_MakeApprovedDateNullable")]
partial class MakeApprovedDateNullable
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<bool>("Approved");
b.Property<DateTime?>("ApprovedTime");
b.Property<bool>("Deleted");
b.Property<double>("Price");
b.Property<int>("ProductId");
b.Property<int>("Quantity");
b.Property<DateTime>("SubmittedTime");
b.HasKey("Id");
b.ToTable("OrderRequests");
});
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
},
new
{
Id = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 23.0,
ProductStockId = 3
},
new
{
Id = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 2.9900000000000002,
ProductStockId = 4
},
new
{
Id = 6,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 49.630000000000003,
ProductStockId = 5
},
new
{
Id = 7,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 4.5599999999999996,
ProductStockId = 6
},
new
{
Id = 8,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 10.01,
ProductStockId = 7
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
},
new
{
Id = 3,
PriceId = 4,
ProductId = 3,
Stock = 32
},
new
{
Id = 4,
PriceId = 5,
ProductId = 4,
Stock = 13
},
new
{
Id = 5,
PriceId = 6,
ProductId = 5,
Stock = 0
},
new
{
Id = 6,
PriceId = 7,
ProductId = 6,
Stock = 1
},
new
{
Id = 7,
PriceId = 8,
ProductId = 7,
Stock = 49
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Stock.Data.Migrations
{
public partial class MakeApprovedDateNullable : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "ApprovedTime",
table: "OrderRequests",
nullable: true,
oldClrType: typeof(DateTime));
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
name: "ApprovedTime",
table: "OrderRequests",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
}
}
}

View File

@@ -0,0 +1,196 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
[Migration("20200102172432_AddSupplierToOrderRequest")]
partial class AddSupplierToOrderRequest
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<bool>("Approved");
b.Property<DateTime?>("ApprovedTime");
b.Property<bool>("Deleted");
b.Property<double>("Price");
b.Property<int>("ProductId");
b.Property<int>("Quantity");
b.Property<DateTime>("SubmittedTime");
b.Property<string>("Supplier");
b.HasKey("Id");
b.ToTable("OrderRequests");
});
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
},
new
{
Id = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 23.0,
ProductStockId = 3
},
new
{
Id = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 2.9900000000000002,
ProductStockId = 4
},
new
{
Id = 6,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 49.630000000000003,
ProductStockId = 5
},
new
{
Id = 7,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 4.5599999999999996,
ProductStockId = 6
},
new
{
Id = 8,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 10.01,
ProductStockId = 7
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
},
new
{
Id = 3,
PriceId = 4,
ProductId = 3,
Stock = 32
},
new
{
Id = 4,
PriceId = 5,
ProductId = 4,
Stock = 13
},
new
{
Id = 5,
PriceId = 6,
ProductId = 5,
Stock = 0
},
new
{
Id = 6,
PriceId = 7,
ProductId = 6,
Stock = 1
},
new
{
Id = 7,
PriceId = 8,
ProductId = 7,
Stock = 49
});
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,22 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ThAmCo.Stock.Data.Migrations
{
public partial class AddSupplierToOrderRequest : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Supplier",
table: "OrderRequests",
nullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Supplier",
table: "OrderRequests");
}
}
}

View File

@@ -0,0 +1,194 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using ThAmCo.Stock.Data;
namespace ThAmCo.Stock.Data.Migrations
{
[DbContext(typeof(StockDbContext))]
partial class StockDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<bool>("Approved");
b.Property<DateTime?>("ApprovedTime");
b.Property<bool>("Deleted");
b.Property<double>("Price");
b.Property<int>("ProductId");
b.Property<int>("Quantity");
b.Property<DateTime>("SubmittedTime");
b.Property<string>("Supplier");
b.HasKey("Id");
b.ToTable("OrderRequests");
});
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<DateTime>("Date");
b.Property<double>("ProductPrice");
b.Property<int>("ProductStockId");
b.HasKey("Id");
b.ToTable("Prices");
b.HasData(
new
{
Id = 1,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 9.9900000000000002,
ProductStockId = 1
},
new
{
Id = 2,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 8.9900000000000002,
ProductStockId = 1
},
new
{
Id = 3,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 17.989999999999998,
ProductStockId = 2
},
new
{
Id = 4,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 23.0,
ProductStockId = 3
},
new
{
Id = 5,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 2.9900000000000002,
ProductStockId = 4
},
new
{
Id = 6,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 49.630000000000003,
ProductStockId = 5
},
new
{
Id = 7,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 4.5599999999999996,
ProductStockId = 6
},
new
{
Id = 8,
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
ProductPrice = 10.01,
ProductStockId = 7
});
});
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<int>("PriceId");
b.Property<int>("ProductId");
b.Property<int>("Stock");
b.HasKey("Id");
b.ToTable("ProductStocks");
b.HasData(
new
{
Id = 1,
PriceId = 2,
ProductId = 1,
Stock = 4
},
new
{
Id = 2,
PriceId = 3,
ProductId = 2,
Stock = 42
},
new
{
Id = 3,
PriceId = 4,
ProductId = 3,
Stock = 32
},
new
{
Id = 4,
PriceId = 5,
ProductId = 4,
Stock = 13
},
new
{
Id = 5,
PriceId = 6,
ProductId = 5,
Stock = 0
},
new
{
Id = 6,
PriceId = 7,
ProductId = 6,
Stock = 1
},
new
{
Id = 7,
PriceId = 8,
ProductId = 7,
Stock = 49
});
});
#pragma warning restore 612, 618
}
}
}