Ejemplo n.º 1
0
        static Program()
        {
          //  Database.SetInitializer(new DatabaseInitializer());
            LiverpoolContext db = new LiverpoolContext(new DbContextOptions<LiverpoolContext>());
            //   db.Database.Initialize(true);
            var store = new UserStore<User, Role, LiverpoolContext, int>(db);
            IPasswordHasher<User> hasher = new PasswordHasher<User>();
            //var provider = new MachineKeyProtectionProvider();
            //var userStore = new UserStore<User, Role, int, UserLogin, UserRole, UserClaim>(_context);
            var userManager = new UserManager<User>(store, null, hasher, null, null, null, null, null, null);
            UserRepository = new UserRepository(db, userManager);
            ForumMessageRepository = new ForumMessageRepository(db);
            ForumSectionRepository = new ForumSectionRepository(db);
            ForumSubsectionRepository = new ForumSubsectionRepository(db);
            ForumThemeRepository = new ForumThemeRepository(db);
            MaterialRepository = new MaterialRepository(db);
            MaterialCategoryRepository = new MaterialCategoryRepository(db);
            MaterialCommentRepository = new MaterialCommentRepository(db);

        }
Ejemplo n.º 2
0
 public ForumSectionService(IMapper mapper, IForumSectionRepository forumSectionRepository)
 {
     _mapper = mapper;
     _forumSectionRepository = forumSectionRepository;
 }