Beispiel #1
0
        /// <summary>
        /// Register <see cref="IDbContextManager"/> and <see cref="IContextFactory{TContext}"/>
        /// </summary>
        public static IContainer ActivateDbContexts(this IContainer container, IDbContextManager contextManager)
        {
            container.SetInstance(contextManager);
            container.ExecuteInstaller(new ContextFactoryInstaller());

            return(container);
        }
Beispiel #2
0
 public CmsController(ILogger logger, IMapper mapper, IDbContextManager contextManager, ICmsService cmsService, INomenclatureService nomenclatureService, ISessionStorageService sessionStorageService)
     : base(logger, mapper, contextManager)
 {
     this.cmsService            = cmsService;
     this.nomenclatureService   = nomenclatureService;
     this.sessionStorageService = sessionStorageService;
 }
Beispiel #3
0
        public TransactionBehavior(IDbContextManager contextManager, GamesDbContext context)
        {
            _contextManager = contextManager;
            Context         = context;

            _contextManager.RegisterContext(Context);
        }
 protected SearchTableController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     string title               = null,
     bool serverOperation       = true,
     bool savePreviousGridState = false,
     bool autoSearch            = true,
     bool selectable            = true,
     bool groupable             = false,
     string tableClass          = "smallform",
     bool isRequestAjax         = false,
     bool isSortable            = false,
     bool disableSearchButton   = false)
     : base(logger, mapper, contextManager)
 {
     this.resource         = resource;
     SearchText            = resource.Get("Search") ?? "Search";
     Title                 = title;
     SavePreviousGridState = savePreviousGridState;
     AutoSearch            = autoSearch;
     ServerOperation       = serverOperation;
     Selectable            = selectable;
     Groupable             = groupable;
     TableClass            = tableClass;
     IsRequestAjax         = isRequestAjax;
     IsSortable            = isSortable;
     DisableSearchButton   = disableSearchButton;
 }
Beispiel #5
0
 public UnitOfWork(IDbContextManager <TDbContext> dbContextManager)
 {
     if (dbContextManager == null)
     {
         throw new ArgumentNullException("dbContextManager");
     }
     this._dbContextManager = dbContextManager;
 }
Beispiel #6
0
 public HistoryController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IHistoryService historyService)
     : base(logger, mapper, contextManager)
 {
     this.historyService = historyService;
 }
 public SettingController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IAdminService adminService)
     : base(logger, mapper, contextManager)
 {
     this.adminService = adminService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseRepository{TEntity}"/> class.
        /// </summary>
        /// <param name="contextManager">
        /// The context manager.
        /// </param>
        public BaseRepository(IDbContextManager contextManager)
        {
            if (contextManager == null)
            {
                throw new ArgumentNullException("contextManager");
            }

            this.ContextManager = contextManager;
        }
Beispiel #9
0
 public AttachmentController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IStorageService storageService)
     : base(logger, mapper, contextManager)
 {
     this.storageService = storageService;
 }
        protected BaseTestClass()
        {
            Logger          = Mock.Create <ILogger>();
            Mapper          = new MapperConfiguration(cfg => { cfg.AddProfile(new AutoMapperProfile()); }).CreateMapper();
            ContextManager  = Mock.Create <IDbContextManager>();
            ResourceManager = Mock.Create <IResourceManager>();

            ModuleInitializer.Run();
        }
 public SearchController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     ISearchService searchService)
     : base(logger, mapper, contextManager)
 {
     this.searchService = searchService;
 }
 public NonPriorityMetadataController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IGeonetworkService geonetworkService)
     : base(logger, mapper, contextManager, resource, Resource.NonPriorityMetadata, autoSearch: true)
 {
     this.geonetworkService = geonetworkService;
 }
 public UserLoginController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IAdminService adminService)
     : base(logger, mapper, contextManager, resource, Resource.UserLoginReport)
 {
     this.adminService = adminService;
 }
Beispiel #14
0
 public RoleController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IRoleService roleService)
     : base(logger, mapper, contextManager, resource, Resource.Roles)
 {
     this.roleService = roleService;
 }
 public BackgroundImagesController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IAdminService adminService,
     IStorageService storageService)
     : base(logger, mapper, contextManager)
 {
     this.adminService   = adminService;
     this.storageService = storageService;
 }
 public GroupsViewController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IGroupService groupService,
     IRestApiService restApiService)
     : base(logger, mapper, contextManager)
 {
     this.groupService   = groupService;
     this.restApiService = restApiService;
 }
Beispiel #17
0
 public GroupController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IRestApiService restApiService,
     IGroupService groupService)
     : base(logger, mapper, contextManager, resource, Resource.Organizations)
 {
     this.restApiService = restApiService;
     this.groupService   = groupService;
 }
 public FaqController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IFaqService faqService,
     INomenclatureService nomenclatureService)
     : base(logger, mapper, contextManager, resource, Resource.FAQ, isSortable: true)
 {
     this.faqService          = faqService;
     this.nomenclatureService = nomenclatureService;
 }
        /// <summary>
        /// Creates a new instance of <see cref="ModelSetupExecutor{TContext}"/>
        /// </summary>
        /// <param name="dbContextManager"></param>
        public ModelSetupExecutor(IDbContextManager dbContextManager)
        {
            _dbContextManager = dbContextManager;

            // Load ModelSetups TODO: Load internals
            _setups = ReflectionTool.GetPublicClasses <IModelSetup>(delegate(Type type)
            {
                // Try to read context from attribute
                var setupAttr = type.GetCustomAttribute <ModelSetupAttribute>();
                return(setupAttr != null && setupAttr.TargetContext == typeof(TContext));
            }).Select(s => (IModelSetup)Activator.CreateInstance((Type)s)).ToArray();
        }
Beispiel #20
0
        protected RepositoryBase(IDbContextManager contextManager)
        {
            if (contextManager == null)
            {
                throw new ArgumentNullException("contextManager");
            }

            ContextManager = contextManager;
            //Context.Configuration.ProxyCreationEnabled = false;

            // deferred to delay initialisation of context
            //_dbSet = Context.Set<T>();
        }
 public PublicationController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     INomenclatureService nomenclatureService,
     IPublicationService publicationService,
     ISessionStorageService sessionStorageService)
     : base(logger, mapper, contextManager, resource, Resource.Publications)
 {
     this.nomenclatureService   = nomenclatureService;
     this.publicationService    = publicationService;
     this.sessionStorageService = sessionStorageService;
 }
 public UserMailService(
     IMapper mapper,
     IRequestData requestData,
     IDbContextManager contextManager,
     IUserService userService,
     IEmailService emailService,
     IMailSender mailSender)
     : base(mapper, requestData)
 {
     this.contextManager = contextManager;
     this.userService    = userService;
     this.emailService   = emailService;
     this.mailSender     = mailSender;
 }
Beispiel #23
0
 public AuthenticationProvider(
     IMapper mapper,
     IDbContextManager contextManager,
     IAccountService accountService,
     IUserService userService,
     IRestApiService restApiService,
     ILogger logger)
 {
     this.mapper         = mapper;
     this.contextManager = contextManager;
     this.accountService = accountService;
     this.userService    = userService;
     this.restApiService = restApiService;
     this.logger         = logger;
 }
Beispiel #24
0
 public PollController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IPollService pollService,
     ISessionStorageService sessionStorageService,
     INomenclatureService nomenclatureService,
     ICacheService cacheService)
     : base(logger, mapper, contextManager, resource, Resource.Polls)
 {
     this.pollService           = pollService;
     this.sessionStorageService = sessionStorageService;
     this.nomenclatureService   = nomenclatureService;
     this.cacheService          = cacheService;
 }
 public ProviderController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IProviderService providerService,
     INomenclatureService nomenclatureService)
     : base(
         logger,
         mapper,
         contextManager,
         resource,
         Resource.Providers,
         isSortable: true,
         disableSearchButton: true)
 {
     this.providerService     = providerService;
     this.nomenclatureService = nomenclatureService;
 }
Beispiel #26
0
 public AccountController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IAccountService accountService,
     IAuthenticationProvider authenticationProvider,
     IUserService userService,
     IUserMailService userMailService,
     ICaptchaService captchaService,
     IRestApiService restApiService)
     : base(logger, mapper, contextManager)
 {
     this.accountService         = accountService;
     this.authenticationProvider = authenticationProvider;
     this.userService            = userService;
     this.userMailService        = userMailService;
     this.captchaService         = captchaService;
     this.restApiService         = restApiService;
 }
 public UserController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     IResourceManager resource,
     IUserService userService,
     IUserMailService userMailService,
     IAccountService accountService,
     INomenclatureService nomenclatureService,
     IRoleService roleService,
     IRestApiService restApiService,
     IGroupService groupService)
     : base(logger, mapper, contextManager, resource, Resource.Users)
 {
     this.userService         = userService;
     this.userMailService     = userMailService;
     this.accountService      = accountService;
     this.nomenclatureService = nomenclatureService;
     this.roleService         = roleService;
     this.restApiService      = restApiService;
     this.groupService        = groupService;
 }
Beispiel #28
0
 public HomeController(
     ILogger logger,
     IMapper mapper,
     IDbContextManager contextManager,
     INomenclatureService nomenclatureService,
     IPublicationService publicationService,
     IAdminService adminService,
     ICacheService cacheService,
     IFaqService faqService,
     ICmsService cmsService,
     IRestApiService restApiService,
     IProviderService providerService)
     : base(logger, mapper, contextManager)
 {
     this.nomenclatureService = nomenclatureService;
     this.publicationService  = publicationService;
     this.adminService        = adminService;
     this.cacheService        = cacheService;
     this.faqService          = faqService;
     this.cmsService          = cmsService;
     this.restApiService      = restApiService;
     this.providerService     = providerService;
 }
Beispiel #29
0
 public SearchGetHotelDetailController(IDbContextManager <MainSqlDbContext> dbContextManager)
 {
     DbContextManager = dbContextManager;
 }
Beispiel #30
0
 public RolePermissionDomain(IMasterUow uow, IDbContextManager <MainSqlDbContext> dbContextManager)
 {
     this.Uow         = uow;
     DbContextManager = dbContextManager;
 }