Exemplo n.º 1
0
        public static IMemcachedConfigurationBuilder UseNodeLocator <TService>(this IMemcachedConfigurationBuilder builder)
            where TService : class, INodeLocator
        {
            builder.Services.AddTransient <INodeLocator, TService>();

            return(builder);
        }
Exemplo n.º 2
0
        public static IMemcachedConfigurationBuilder SetOptions(this IMemcachedConfigurationBuilder builder, ISocketOptions options)
        {
            builder.Services.AddSingleton(options);
            builder.Services.AddTransient <ISocketFactory, AsyncSocketFactory>();

            return(builder);
        }
Exemplo n.º 3
0
        public static IMemcachedConfigurationBuilder UseItemFormatter <TService>(this IMemcachedConfigurationBuilder builder)
            where TService : class, IItemFormatter
        {
            builder.Services.AddTransient <IItemFormatter, TService>();

            return(builder);
        }
Exemplo n.º 4
0
        public static IMemcachedConfigurationBuilder UseSocketFactory <TService>(this IMemcachedConfigurationBuilder builder)
            where TService : class, ISocketFactory
        {
            builder.Services.AddTransient <ISocketFactory, TService>();

            return(builder);
        }
Exemplo n.º 5
0
        public static IMemcachedConfigurationBuilder UseFailurePolicyFactory(this IMemcachedConfigurationBuilder builder, Func <IServiceProvider, IFailurePolicyFactory> implementationFactory)
        {
            builder.Services.AddTransient(implementationFactory);

            return(builder);
        }
Exemplo n.º 6
0
        public static IMemcachedConfigurationBuilder UseNodeLocator(this IMemcachedConfigurationBuilder builder, Func <IServiceProvider, INodeLocator> implementationFactory)
        {
            builder.Services.AddTransient(implementationFactory);

            return(builder);
        }
Exemplo n.º 7
0
        public static IMemcachedConfigurationBuilder SetOptions(this IMemcachedConfigurationBuilder builder, IMemcachedClientOptions options)
        {
            builder.Services.AddSingleton(options);

            return(builder);
        }