2021-11-26 12:31:33 +01:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2021-11-23 22:56:22 +01:00
|
|
|
|
|
|
|
|
namespace zero.Applications;
|
|
|
|
|
|
|
|
|
|
internal static class ServiceCollectionExtensions
|
|
|
|
|
{
|
2021-11-26 12:31:33 +01:00
|
|
|
public static IServiceCollection AddZeroApplications(this IServiceCollection services, IConfiguration config)
|
2021-11-23 22:56:22 +01:00
|
|
|
{
|
|
|
|
|
services.AddScoped<IApplicationResolver, ApplicationResolver>();
|
2021-11-24 13:56:08 +01:00
|
|
|
services.AddScoped<IApplicationStore, ApplicationStore>();
|
2021-11-26 12:31:33 +01:00
|
|
|
|
|
|
|
|
services.AddOptions<ApplicationOptions>().Bind(config.GetSection("Zero:Applications"));
|
|
|
|
|
|
2021-11-23 22:56:22 +01:00
|
|
|
return services;
|
|
|
|
|
}
|
|
|
|
|
}
|