Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseQueryRequestHandler{TRequest, TResponse}"/> class.
        /// </summary>
        /// <param name="module">The query handler module.</param>
        public BaseQueryRequestHandler(IQueryHandlerModule module)
        {
            Ensure.ArgumentNotNull(module, nameof(module));

            Context           = module.Context ?? throw new UnexpectedNullException("The context cannot be null.");
            Constants         = module.Constants ?? throw new UnexpectedNullException("The application constants cannot be null.");
            PrincipalProvider = module.PrincipalProvider ?? throw new UnexpectedNullException("The principal provider cannot be null.");
            Serializer        = module.Serializer ?? throw new UnexpectedNullException("The JSON serializer cannot be null.");
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetZipQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 /// <param name="configuration">The application configuration.</param>
 /// <param name="writer">The archive writer.</param>
 /// <param name="fileSystemStrategy">The file system strategy.</param>
 public GetZipQueryHandler(
     IQueryHandlerModule module,
     IAppConfiguration configuration,
     IArchiveWriter writer,
     IFileSystemStrategy fileSystemStrategy)
     : base(module)
 {
     this.configuration      = configuration ?? throw new ArgumentNullException(nameof(configuration));
     this.writer             = writer ?? throw new ArgumentNullException(nameof(writer));
     this.fileSystemStrategy = fileSystemStrategy ?? throw new ArgumentNullException(nameof(fileSystemStrategy));
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GetImageQueryHandler"/> class.
        /// </summary>
        /// <param name="module">The query handler module.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="fileSystemStrategy">The file system strategy.</param>
        public GetImageQueryHandler(
            IQueryHandlerModule module,
            IAppConfiguration configuration,
            IFileSystemStrategy fileSystemStrategy)
            : base(module)
        {
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

            if (fileSystemStrategy == null)
            {
                throw new ArgumentNullException(nameof(fileSystemStrategy));
            }

            fileSystem = fileSystemStrategy.Create(configuration.Options.WorkingDirectory);
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetByIdQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 public GetByIdQueryHandler(IQueryHandlerModule module)
     : base(module)
 {
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetPaginatedQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 public GetPaginatedQueryHandler(IQueryHandlerModule module)
     : base(module)
 {
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 /// <param name="factory">The factory.</param>
 /// <exception cref="ArgumentNullException">factory</exception>
 public GetQueryHandler(IQueryHandlerModule module, IAppInfoFactory factory)
     : base(module)
 {
     this.factory = factory ?? throw new ArgumentNullException(nameof(factory));
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 /// <param name="configuration">The configuration.</param>
 public GetQueryHandler(IQueryHandlerModule module, IApiConfiguration configuration)
     : base(module)
 {
     this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
 }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetPaginatedQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 /// <param name="appLogRepository">The application log repository.</param>
 public GetPaginatedQueryHandler(IQueryHandlerModule module, IAppLogRepository appLogRepository)
     : base(module)
 {
     this.appLogRepository = appLogRepository ?? throw new ArgumentNullException(nameof(appLogRepository));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GetByIdQueryHandler"/> class.
 /// </summary>
 /// <param name="module">The query handler module.</param>
 /// <param name="constants">The application constants.</param>
 public GetByIdQueryHandler(IQueryHandlerModule module, IApplicationConstants constants)
     : base(module)
 {
     this.constants = constants ?? throw new ArgumentNullException(nameof(constants));
 }