Пример #1
0
 public WebApiHelper(SimpleLogFactory simpleLogFactory)
 {
     //todo: refactor code
     //var response = await httpClient.GetAsync(uri).ConfigureAwait(false);
     //var handler = new HttpClientHandler { AutomaticDecompression = DecompressionMethods.GZip };
     //_httpClient = new HttpClient(handler);
     _httpClient = new HttpClient();
     _simpleLog  = simpleLogFactory.CreateLogFor(this);
 }
Пример #2
0
 public static ISimpleLog CreateLogFor(this SimpleLogFactory factory, object instance)
 {
     if (instance == null)
     {
         throw new ArgumentNullException(nameof(instance));
     }
     if (instance is Type type)
     {
         return(factory.CreateLogFor(type));
     }
     return(factory.CreateLogFor(instance.GetType()));
 }
Пример #3
0
 public static ISimpleLog CreateLogFor <T>(this SimpleLogFactory factory)
 {
     return(factory.CreateLogFor(typeof(T)));
 }
Пример #4
0
 public static ISimpleLog CreateLogFor(this SimpleLogFactory factory, Type type)
 {
     return(factory.CreateLog(type.Name));
 }