Beispiel #1
0
 public DummiesController(HefnyDBContext context)
 {
     this.context = context;
     if (context.Dummies.Count() == 0)
     {
         context.Dummies.Add(new Dummies {
             Id = 0, Name = "Default Name", IsActive = true
         });
         context.SaveChanges();
     }
 }
        public ProductController(HefnyDBContext context)
        {
            this.context = context;

            if (context.Product.Count() == 0)
            {
                context.Product.Add(new Product {
                    Id = 0, ProdDesc = "desc", ProdName = "defualt Name", ProdPrice = 0, UpdatedAt = DateTime.Now.Date
                });
                context.SaveChanges();
            }
        }
Beispiel #3
0
        public EmployeeDetailsController(HefnyDBContext context)
        {
            this.context = context;

            if (context.EmployeeDetails.Count() == 0)
            {
                context.EmployeeDetails.Add(new EmployeeDetails {
                    Address = "", DateOfBirth = DateTime.Now.Date, Emailid = "", EmpId = 0, EmpName = "Default insertion", Gender = "male", PinCode = "pincode"
                });
                context.SaveChanges();
            }
        }