示例#1
0
 public Execution(ILogger logger, IWebAPIClient webApiClient, BiblosClient biblosClient)
 {
     _logger             = logger;
     _biblosClient       = biblosClient;
     _webApiClient       = webApiClient;
     _biblosArchives     = _biblosClient.Document.GetArchives();
     _serializerSettings = new JsonSerializerSettings
     {
         NullValueHandling          = NullValueHandling.Ignore,
         TypeNameHandling           = TypeNameHandling.Objects,
         ReferenceLoopHandling      = ReferenceLoopHandling.Ignore,
         PreserveReferencesHandling = PreserveReferencesHandling.All
     };
     try
     {
         short?fascicleLocationId = _webApiClient.GetParameterFascicleMiscellaneaLocation().Result;
         if (fascicleLocationId.HasValue)
         {
             _fascicleLocation = _webApiClient.GetLocationAsync(fascicleLocationId.Value).Result;
         }
         if (_fascicleLocation == null)
         {
             throw new ArgumentException("Fascicle Location is empty", "FascicleLocation");
         }
     }
     catch (Exception ex)
     {
         _logger.WriteError(new LogMessage("error orrouring in get fascicle parameters"), ex, LogCategories);
         throw;
     }
 }