Esempio n. 1
0
        public AccountController(MyAccountContext context)
        {
            _context = context;

            if (_context.Accounts.Count() == 0)
            {
                // Create a new TodoItem if collection is empty,
                // which means you can't delete all TodoItems.
                _context.Accounts.Add(new Account {
                    Name = "Item1"
                });
                _context.SaveChanges();
            }
        }
 public RecordController(MyAccountContext context) => _context = context;