public JsonApiWriter(
     IJsonApiSerializer serializer,
     ILoggerFactory loggerFactory)
 {
     _serializer = serializer;
     _logger     = loggerFactory.CreateLogger <JsonApiWriter>();
 }
        public JsonApiWriter(IJsonApiSerializer serializer, IExceptionHandler exceptionHandler, ILoggerFactory loggerFactory)
        {
            _serializer       = serializer;
            _exceptionHandler = exceptionHandler;

            _logger = loggerFactory.CreateLogger <JsonApiWriter>();
        }
        public JsonApiWriter(IJsonApiSerializer serializer,
                             ILoggerFactory loggerFactory)
        {
            _serializer = serializer;
            _logger     = loggerFactory.CreateLogger <JsonApiWriter>();

            _logger.LogTrace("Executing constructor.");
        }
 public NotificationHookNotifier(
     IOperationsProcessor operationsProcessor,
     IJsonApiSerializer serializer,
     IResourceGraph resourceGraph,
     IDbContextResolver dbContextResolver,
     IHubContext <JSONAPIHub> dataHub
     ) : base(operationsProcessor, serializer, resourceGraph, dbContextResolver, dataHub)
 {
 }
        public JsonApiWriter(IJsonApiSerializer serializer, IExceptionHandler exceptionHandler, ILoggerFactory loggerFactory)
        {
            ArgumentGuard.NotNull(serializer, nameof(serializer));
            ArgumentGuard.NotNull(exceptionHandler, nameof(exceptionHandler));
            ArgumentGuard.NotNull(loggerFactory, nameof(loggerFactory));

            _serializer       = serializer;
            _exceptionHandler = exceptionHandler;
            _traceWriter      = new TraceLogWriter <JsonApiWriter>(loggerFactory);
        }
Exemple #6
0
        public JsonApiWriter(IJsonApiSerializer serializer, IExceptionHandler exceptionHandler, ILoggerFactory loggerFactory)
        {
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _serializer       = serializer ?? throw new ArgumentNullException(nameof(serializer));
            _exceptionHandler = exceptionHandler ?? throw new ArgumentNullException(nameof(exceptionHandler));
            _traceWriter      = new TraceLogWriter <JsonApiWriter>(loggerFactory);
        }
Exemple #7
0
        public JsonApiSerializerBenchmarks()
        {
            IResourceGraph     resourceGraph     = DependencyFactory.CreateResourceGraph();
            IFieldsToSerialize fieldsToSerialize = CreateFieldsToSerialize(resourceGraph);

            var metaBuilderMock    = new Mock <IMetaBuilder <BenchmarkResource> >();
            var linkBuilderMock    = new Mock <ILinkBuilder>();
            var includeBuilderMock = new Mock <IIncludedResourceObjectBuilder>();

            var resourceObjectBuilder = new ResourceObjectBuilder(resourceGraph, new ResourceObjectBuilderSettings());

            _jsonApiSerializer = new ResponseSerializer <BenchmarkResource>(metaBuilderMock.Object, linkBuilderMock.Object,
                                                                            includeBuilderMock.Object, fieldsToSerialize, resourceObjectBuilder);
        }
        public JsonApiSerializerBenchmarks()
        {
            var                options           = new JsonApiOptions();
            IResourceGraph     resourceGraph     = _dependencyFactory.CreateResourceGraph(options);
            IFieldsToSerialize fieldsToSerialize = CreateFieldsToSerialize(resourceGraph);

            IMetaBuilder metaBuilder = new Mock <IMetaBuilder>().Object;
            ILinkBuilder linkBuilder = new Mock <ILinkBuilder>().Object;
            IIncludedResourceObjectBuilder includeBuilder = new Mock <IIncludedResourceObjectBuilder>().Object;

            var resourceObjectBuilder = new ResourceObjectBuilder(resourceGraph, new ResourceObjectBuilderSettings());

            _jsonApiSerializer = new ResponseSerializer <BenchmarkResource>(metaBuilder, linkBuilder,
                                                                            includeBuilder, fieldsToSerialize, resourceObjectBuilder, options);
        }
Exemple #9
0
 public JsonApiResponseFactory(IJsonApiSerializer jsonApiSerializer, IJsonApiContext jsonApiContext)
 {
     _jsonApiSerializer = jsonApiSerializer;
     _jsonApiContext    = jsonApiContext;
 }