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

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

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

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

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

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

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

            return(builder);
        }