Ejemplo n.º 1
0
 public WebCaller(CallerSetting callerSetting)
 {
     _client     = callerSetting.Client;
     _serializer = callerSetting.Serializer;
     _logger     = callerSetting.Logger;
     new ClientSettingsValidator().Validate(callerSetting.ClientSetting);
     _clientSetting            = callerSetting.ClientSetting;
     _serializerSettings       = callerSetting.SerializerSetting;
     _errorPayloadType         = callerSetting.ErrorPayloadType;
     _errorPayloadTypeSelector = callerSetting.ErrorPayloadTypeSelector;
     SetDefaults();
 }
 private void SetDefaults(CallerSetting callerSettings)
 {
     if (callerSettings.Client == null)
     {
         callerSettings.Client = DefaultCallerSettings.DefaultHttpClient;
     }
     if (callerSettings.Serializer == null)
     {
         callerSettings.Serializer = DefaultCallerSettings.DefaultSerializer;
     }
     if (callerSettings.SerializerSetting == null)
     {
         callerSettings.SerializerSetting = DefaultCallerSettings.DefaultSerializerSettings;
     }
     if (callerSettings.ClientSetting == null)
     {
         callerSettings.ClientSetting = DefaultCallerSettings.DefaultClientSetting;
     }
 }