예제 #1
0
        public GroupsController(IdentityManagementDbContext context)
        {
            _context = context;

            if (_context.Groups.Count() == 0)
            {
                _context.Groups.Add(new Group {
                    Name = "Security Council"
                });

                _context.SaveChanges();
            }
        }
예제 #2
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();
            }
        }
 public UsersEventRepository(IdentityManagementDbContext context)
 {
     _context = context;
 }
예제 #4
0
 public UserHandler(IdentityManagementDbContext context)
 {
     _context    = context;
     _repository = new UsersEventRepository(_context);
 }