public KbarticleController(WapiDBContext context) { _context = context; if (_context.Kbarticle.Count() == 0) { _context.Kbarticle.Add(new Kbarticle { Name = "New Article", Content = "" }); _context.SaveChanges(); } }
public UserController(WapiDBContext context) { _context = context; if (_context.User.Count() == 0) { _context.User.Add(new User { Fname = "Christophe", Pname = "Maille" }); _context.SaveChanges(); } }
public ProductController(WapiDBContext context) { _context = context; if (_context.Product.Count() == 0) { _context.Product.Add(new Product { Name = "Switch", Category = "COMM", ProductType = "Network device" }); _context.SaveChanges(); } }
public CommentsController(WapiDBContext context) { _context = context; if (_context.Comment.Count() == 0) { _context.Comment.Add(new Comment { Title = "New Comment", Content = "" }); _context.Comment.Add(new Comment { Title = "Another New Comment", Content = "" }); _context.SaveChanges(); } }