Esempio n. 1
0
 public WritePersistedQueryMiddleware(
     RequestDelegate next,
     IDocumentHashProvider documentHashProvider,
     IWriteStoredQueries persistedQueryStore)
 {
     _next = next ??
             throw new ArgumentNullException(nameof(next));
     _hashProvider = documentHashProvider ??
                     throw new ArgumentNullException(nameof(documentHashProvider));
     _persistedQueryStore = persistedQueryStore ??
                            throw new ArgumentNullException(nameof(persistedQueryStore));
 }
        public WritePersistedQueryMiddleware(
            QueryDelegate next,
            IWriteStoredQueries writeStoredQueries,
            IDocumentHashProvider documentHashProvider)
        {
            if (documentHashProvider is null)
            {
                throw new ArgumentNullException(nameof(documentHashProvider));
            }

            _next = next
                    ?? throw new ArgumentNullException(nameof(next));
            _writeStoredQueries = writeStoredQueries
                                  ?? throw new ArgumentNullException(nameof(writeStoredQueries));
            _hashName = documentHashProvider.Name;
        }