コード例 #1
0
ファイル: Configuration.cs プロジェクト: minhvh107/minhvh
 private void CreateProductCategorySample(MinhvhDbContext context)
 {
     if (!context.ProductCategories.Any())
     {
         List <ProductCategory> listProductCategories = new List <ProductCategory>
         {
             new ProductCategory()
             {
                 Name = "Điện lạnh", Alias = "dien-lanh", CreatedBy = "admin", Status = true, CreatedDate = DateTime.Now
             },
             new ProductCategory()
             {
                 Name = "Đồ gia dụng", Alias = "do-gia-dung", CreatedBy = "admin", Status = true, CreatedDate = DateTime.Now
             },
             new ProductCategory()
             {
                 Name = "Quần áo", Alias = "dien-lanh", CreatedBy = "admin", Status = true, CreatedDate = DateTime.Now
             }
         };
         context.ProductCategories.AddRange(listProductCategories);
         context.SaveChanges();
     }
 }
コード例 #2
0
ファイル: DbFactory.cs プロジェクト: minhvh107/minhvh
 public MinhvhDbContext Init()
 {
     return(dbContext ?? (dbContext = new MinhvhDbContext()));
 }
コード例 #3
0
 public ApplicationUserStore(MinhvhDbContext context)
     : base(context)
 {
 }