Beispiel #1
0
        public KbarticleController(WapiDBContext context)
        {
            _context = context;

            if (_context.Kbarticle.Count() == 0)
            {
                _context.Kbarticle.Add(new Kbarticle {
                    Name = "New Article", Content = ""
                });
                _context.SaveChanges();
            }
        }
Beispiel #2
0
        public UserController(WapiDBContext context)
        {
            _context = context;

            if (_context.User.Count() == 0)
            {
                _context.User.Add(new User {
                    Fname = "Christophe", Pname = "Maille"
                });
                _context.SaveChanges();
            }
        }
Beispiel #3
0
        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();
            }
        }
Beispiel #4
0
        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();
            }
        }