Пример #1
0
        public UsersController(IdentityManagementDbContext context)
        {
            _context    = context;
            _handler    = new UserHandler(_context);
            _repository = new UsersRepository(_context);
            _events     = new UsersEventRepository(_context);

            if (_context.Users.Count() == 0)
            {
                _context.Users.Add(new User
                {
                    FirstName = "Fred",
                    LastName  = "Flintstone"
                });

                _context.SaveChanges();
            }
        }
Пример #2
0
 public UserHandler(IdentityManagementDbContext context)
 {
     _context    = context;
     _repository = new UsersEventRepository(_context);
 }