public static IOutkeepServerBuilder AddNullGrainStorage(this IOutkeepServerBuilder builder, string name)
 {
     return(builder.ConfigureServices(services =>
     {
         services.AddNullGrainStorage(name);
     }));
 }
 public static IOutkeepServerBuilder AddNullGrainStorageAsDefault(this IOutkeepServerBuilder builder)
 {
     return(builder.ConfigureServices(services =>
     {
         services.AddNullGrainStorageAsDefault();
     }));
 }
        public static IOutkeepServerBuilder ConfigureServices(this IOutkeepServerBuilder builder, Action <IServiceCollection> configure)
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (configure is null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(builder.ConfigureServices((context, services) => configure(services)));
        }
        /// <summary>
        /// Sets up an Outkeep HTTP API on this <see cref="IOutkeepServerBuilder"/> instance.
        /// Successive calls to this extension method are cumulative and will only create a single API instance.
        /// </summary>
        public static IOutkeepServerBuilder UseHttpApi(this IOutkeepServerBuilder outkeep, Action <OutkeepHttpApiServerOptions> configure)
        {
            if (outkeep == null)
            {
                throw new ArgumentNullException(nameof(outkeep));
            }

            return(outkeep.ConfigureServices((context, services) =>
            {
                services.TryAddHostedService <OutkeepHttpApiHostedService>();
                services.AddOptions <OutkeepHttpApiServerOptions>()
                .Configure(configure)
                .ValidateDataAnnotations();
            }));
        }
        public static IOutkeepServerBuilder Configure <TOptions>(this IOutkeepServerBuilder builder, Action <TOptions> configure) where TOptions : class
        {
            if (builder is null)
            {
                throw new ArgumentNullException(nameof(builder));
            }
            if (configure is null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            return(builder.ConfigureServices(services =>
            {
                services.Configure(configure);
            }));
        }
Exemple #6
0
 public static IOutkeepServerBuilder UseAzure(this IOutkeepServerBuilder builder)
 {
     return(builder.ConfigureServices(services =>
     {
     }));
 }