Auto
Auto
using System;
using BusinessObject;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BusinessObject.Migrations
[DbContext(typeof(ApplicationDBContext))]
modelBuilder
.HasAnnotation("ProductVersion", "6.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("BusinessObject.Category", b =>
{
b.Property<int>("CategoryId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("CategoryId"));
b.Property<string>("CategoryName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
b.HasKey("CategoryId");
b.ToTable("Categories");
b.HasData(
new
CategoryId = 1,
CategoryName = "Beverages"
},
new
CategoryId = 2,
CategoryName = "Condiments"
},
new
CategoryId = 3,
CategoryName = "Confections"
},
new
CategoryId = 4,
},
new
CategoryId = 5,
CategoryName = "Grains/Cereals"
},
new
CategoryId = 6,
CategoryName = "Meat/Poultry"
},
new
CategoryId = 7,
CategoryName = "Produce"
},
new
CategoryId = 8,
CategoryName = "Seafood"
});
});
modelBuilder.Entity("BusinessObject.Member", b =>
b.Property<int>("MemberId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("MemberId"));
b.Property<string>("City")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CompanyName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
b.Property<string>("Country")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("MemberId");
b.ToTable("Members");
});
modelBuilder.Entity("BusinessObject.Order", b =>
b.Property<int>("OrderId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("OrderId"));
b.Property<float>("Freight")
.HasColumnType("real");
b.Property<int>("MemberId")
.HasColumnType("int");
b.Property<DateTime?>("OrderDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("RequiredDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("ShippedDate")
.HasColumnType("datetime2");
b.HasKey("OrderId");
b.ToTable("Orders");
});
modelBuilder.Entity("BusinessObject.OrderDetail", b =>
b.Property<int>("OrderId")
.HasColumnType("int");
b.Property<string>("ProductId")
.HasColumnType("nvarchar(450)");
b.Property<float>("Discount")
.HasColumnType("real");
b.Property<int>("Quantity")
.HasColumnType("int");
b.Property<int>("UnitPrice")
.HasColumnType("int");
b.HasKey("OrderId", "ProductId");
b.ToTable("OrderDetails");
});
modelBuilder.Entity("BusinessObject.Product", b =>
b.Property<int>("ProductId")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("ProductId"));
b.Property<int>("CategoryId")
.HasColumnType("int");
b.Property<string>("ProductName")
.IsRequired()
.HasMaxLength(40)
.HasColumnType("nvarchar(40)");
b.Property<int>("UnitInStock")
.HasColumnType("int");
b.Property<int>("UnitPrice")
.HasColumnType("int");
b.Property<float>("Weight")
.HasColumnType("real");
b.HasKey("ProductId");
b.HasIndex("CategoryId");
b.ToTable("Products");
b.HasData(
new
ProductId = 1,
CategoryId = 1,
UnitInStock = 3,
UnitPrice = 10,
Weight = 1.1f
},
new
ProductId = 2,
CategoryId = 2,
UnitInStock = 2,
UnitPrice = 10,
Weight = 2.1f
},
new
ProductId = 3,
CategoryId = 3,
UnitInStock = 1,
UnitPrice = 11,
Weight = 3.1f
},
new
ProductId = 4,
CategoryId = 4,
ProductName = "Nabati",
UnitInStock = 2,
UnitPrice = 10,
Weight = 4.1f
},
new
ProductId = 5,
CategoryId = 5,
UnitInStock = 3,
UnitPrice = 11,
Weight = 5.1f
},
new
ProductId = 6,
CategoryId = 6,
ProductName = "Meatdeli",
UnitInStock = 1,
UnitPrice = 10,
Weight = 6.1f
},
new
ProductId = 7,
CategoryId = 7,
UnitInStock = 5,
UnitPrice = 10,
Weight = 7.1f
},
new
ProductId = 8,
CategoryId = 8,
UnitInStock = 3,
UnitPrice = 11,
Weight = 8.1f
});
});
modelBuilder.Entity("BusinessObject.Product", b =>
{
b.HasOne("BusinessObject.Category", "Category")
.WithMany("Products")
.HasForeignKey("CategoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Category");
});
modelBuilder.Entity("BusinessObject.Category", b =>
b.Navigation("Products");
});