コード例 #1
0
 public override void ConfigureServices(ServiceConfigurationContext context)
 {
     Configure <ContractOptions>(o => o.ContractDeploymentAuthorityRequired = false);
     context.Services.RemoveAll <IPreExecutionPlugin>();
     context.Services.Replace(ServiceDescriptor
                              .Singleton <IBlockTimeProvider, DelayBlockTimeProvider>());
 }
コード例 #2
0
        public static IRegistration CreateWindsorRegistration(this Microsoft.Extensions.DependencyInjection.ServiceDescriptor service)
        {
            if (service.ServiceType.ContainsGenericParameters)
            {
                return(RegistrationAdapter.FromOpenGenericServiceDescriptor(service));
            }

            return(RegistrationAdapter.FromServiceDescriptor(service));
        }
コード例 #3
0
 public static IRegistration CreateWindsorRegistration(this Microsoft.Extensions.DependencyInjection.ServiceDescriptor service)
 {
     if (service.ServiceType.ContainsGenericParameters)
     {
         return(RegistrationAdapter.FromOpenGenericServiceDescriptor(service));
     }
     else
     {
         var method = typeof(RegistrationAdapter).GetMethod("FromServiceDescriptor", BindingFlags.Static | BindingFlags.Public).MakeGenericMethod(service.ServiceType);
         return(method.Invoke(null, new object[] { service }) as IRegistration);
     }
 }
コード例 #4
0
 public static TBuilder AddProtobufProtocol <TBuilder>(
     this TBuilder builder,
     IReadOnlyDictionary <int, Type> protobufTypes
     ) where TBuilder : ISignalRBuilder
 {
     builder.Services.RemoveAll <IHubProtocol>();
     builder.Services.TryAddEnumerable(
         ServiceDescriptor.Singleton <IHubProtocol>(
             new ProtobufProtocol(protobufTypes)
             )
         );
     return(builder);
 }
 public static void TryAddEnumerable(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor)
 {
 }
 public static Microsoft.Extensions.DependencyInjection.IServiceCollection Replace(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor)
 {
     throw null;
 }
コード例 #7
0
 public static void TryAdd(this Microsoft.Extensions.DependencyInjection.IServiceCollection collection, Microsoft.Extensions.DependencyInjection.ServiceDescriptor descriptor) => throw null;