コード例 #1
0
        public void WhenConstructedWithNullQuerySerializerShouldThrowArgumentNullException()
        {
            var dbContextFactory             = new Mock <IDbContextFactory>().Object;
            IQuerySerializer querySerializer = null;
            var logger = new Mock <ILogger <EntityFrameworkCoreQueryStore> >().Object;

            Action act = () => new EntityFrameworkCoreQueryStore(dbContextFactory: dbContextFactory, querySerializer: querySerializer, logger: logger);

            act.Should().Throw <ArgumentNullException>().
            And.ParamName.Should().Be("querySerializer");
        }
コード例 #2
0
        public EntityFrameworkCoreQueryStore(IDbContextFactory dbContextFactory,
                                             IQuerySerializer querySerializer,
                                             ILogger <EntityFrameworkCoreQueryStore> logger)
        {
            if (dbContextFactory == null)
            {
                throw new ArgumentNullException(nameof(dbContextFactory));
            }
            if (querySerializer == null)
            {
                throw new ArgumentNullException(nameof(querySerializer));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _dbContextFactory = dbContextFactory;
            _querySerializer  = querySerializer;
            _logger           = logger;
        }
コード例 #3
0
 public GetWebpageCachingInfo(IQuerySerializer querySerializer, PageDefaultsSettings settings)
 {
     _querySerializer = querySerializer;
     _settings        = settings;
 }