public UserController() { userAccountRepository = ServiceLocator.Instance.GetService <IExtensionRepository <UserAccount> >(); orderRepository = ServiceLocator.Instance.GetService <IExtensionRepository <OrderInfo> >(); userRepository = ServiceLocator.Instance.GetService <IExtensionRepository <UserInfo> >(); userExtRepository = ServiceLocator.Instance.GetService <IExtensionRepository <UserExtension> >(); logRepository = ServiceLocator.Instance.GetService <IMongoRepository <ActionLog> >(); userExtRepository.SetDataContext(db); userRepository.SetDataContext(db); userAccountRepository.SetDataContext(db); }
public BaseController() { db = new ManagerContext(); menuRepository = new ManagerEfRepository <WebManageMenus>(); roleRepository = new ManagerEfRepository <WebManageRoles>(); webDataCtrlRepository = new ManagerEfRepository <WebDataCtrl>(); webDataSettingRepository = new ManagerEfRepository <WebDataSetting>(); departmentsRepository = new ManagerEfRepository <WebDepartments>(); userRepository = new ManagerEfRepository <WebManageUsers>(); webManageRoles_WebManageMenus_Authority_RRepository = new ManagerEfRepository <WebManageRoles_WebManageMenus_Authority_R>(); webLoggerRepository = new ManagerEfRepository <WebLogger>(); webCommonAreasRepository = new ManagerEfRepository <WebCommonAreas>(); webAuthorityCommandsRepository = new ManagerEfRepository <Lind.DDD.Domain.WebAuthorityCommands>(); menuRepository.SetDataContext(db); roleRepository.SetDataContext(db); webDataCtrlRepository.SetDataContext(db); webDataSettingRepository.SetDataContext(db); departmentsRepository.SetDataContext(db); userRepository.SetDataContext(db); webManageRoles_WebManageMenus_Authority_RRepository.SetDataContext(db); webLoggerRepository.SetDataContext(db); webCommonAreasRepository.SetDataContext(db); webAuthorityCommandsRepository.SetDataContext(db); }