Пример #1
0
 public FilesService(IConfiguration configuration, FileServicesClient filesClient, IMapper mapper, LookupService lookupService, LocationService locationService, IAppCache cache)
 {
     _filesClient = filesClient;
     _filesClient.JsonSerializerSettings.ContractResolver = new SafeContractResolver {
         NamingStrategy = new CamelCaseNamingStrategy()
     };
     _cache = cache;
     _cache.DefaultCachePolicy.DefaultCacheDurationSeconds = int.Parse(configuration.GetNonEmptyValue("Caching:FileExpiryMinutes")) * 60;
     Civil    = new CivilFilesService(configuration, filesClient, mapper, lookupService, locationService, _cache);
     Criminal = new CriminalFilesService(configuration, filesClient, mapper, lookupService, locationService, _cache);
 }
Пример #2
0
        public FilesService(IConfiguration configuration,
                            FileServicesClient filesClient,
                            IMapper mapper,
                            LookupService lookupService,
                            LocationService locationService,
                            IAppCache cache,
                            ClaimsPrincipal claimsPrincipal)
        {
            _filesClient = filesClient;
            _filesClient.JsonSerializerSettings.ContractResolver = new SafeContractResolver {
                NamingStrategy = new CamelCaseNamingStrategy()
            };
            _cache = cache;
            _cache.DefaultCachePolicy.DefaultCacheDurationSeconds = int.Parse(configuration.GetNonEmptyValue("Caching:FileExpiryMinutes")) * 60;
            Civil    = new CivilFilesService(configuration, filesClient, mapper, lookupService, locationService, _cache, claimsPrincipal);
            Criminal = new CriminalFilesService(configuration, filesClient, mapper, lookupService, locationService, _cache, claimsPrincipal);

            _applicationCode           = configuration.GetNonEmptyValue("Request:ApplicationCd");
            _requestAgencyIdentifierId = claimsPrincipal.AgencyCode();
            _requestPartId             = claimsPrincipal.ParticipantId();
        }