예제 #1
0
 public DefaultResourceService(
     IFieldsToSerialize fieldsToSerialize,
     IEnumerable <IQueryParameterService> queryParameters,
     IJsonApiOptions options,
     ILoggerFactory loggerFactory,
     IResourceRepository <TResource, TId> repository,
     IResourceContextProvider provider,
     IResourceChangeTracker <TResource> resourceChangeTracker,
     IResourceFactory resourceFactory,
     IResourceHookExecutor hookExecutor = null)
 {
     _fieldsToSerialize   = fieldsToSerialize;
     _includeService      = queryParameters.FirstOrDefault <IIncludeService>();
     _sparseFieldsService = queryParameters.FirstOrDefault <ISparseFieldsService>();
     _pageService         = queryParameters.FirstOrDefault <IPageService>();
     _sortService         = queryParameters.FirstOrDefault <ISortService>();
     _filterService       = queryParameters.FirstOrDefault <IFilterService>();
     _options             = options;
     _logger                 = loggerFactory.CreateLogger <DefaultResourceService <TResource, TId> >();
     _repository             = repository;
     _resourceChangeTracker  = resourceChangeTracker;
     _resourceFactory        = resourceFactory;
     _hookExecutor           = hookExecutor;
     _currentRequestResource = provider.GetResourceContext <TResource>();
 }
예제 #2
0
 public FieldsToSerialize(IResourceGraph resourceGraph,
                          ISparseFieldsService sparseFieldsService,
                          IResourceDefinitionProvider provider)
 {
     _resourceGraph       = resourceGraph;
     _sparseFieldsService = sparseFieldsService;
     _provider            = provider;
 }