public static IServiceCollection AddWcfClientWithLog <I, T>(this IServiceCollection services, string key)
     where I : class
     where T : class, I
 => services.AddSingleton <I>(x =>
 {
     var instance = HttpBindingExtensions.GetWcfInstance <I, T>(key, x);
     return(DispatchLoggingProxy <I> .Create(instance, x));
 });
Esempio n. 2
0
 public static IServiceCollection AddScopedWithLog <TInterface, TService>(this IServiceCollection services) where TInterface : class where TService : class, TInterface
 {
     return
         (services.AddScoped <TService>()
          .AddScoped(x => DispatchLoggingProxy <TInterface> .Create(x.GetService <TService>(), x)));
 }