1#if NETSTANDARD2_0 || NET5_0
10using Microsoft.Extensions.Configuration;
11using Microsoft.Extensions.DependencyInjection;
12using Microsoft.Extensions.DependencyInjection.Extensions;
19 public static class ConfigurationExtensions
25 public static ICslaBuilder AddCsla(
this IServiceCollection services)
27 return AddCsla(services,
null);
35 public static ICslaBuilder AddCsla(
this IServiceCollection services, Action<CslaConfiguration> config)
37 ApplicationContext.SetServiceCollection(services);
38 services.TryAddTransient(typeof(IDataPortal<>), typeof(DataPortal<>));
39 config?.Invoke(CslaConfiguration.Configure());
40 return new CslaBuilder(services);
48 public static IConfiguration ConfigureCsla(
this IConfiguration config)
50 config.Bind(
"csla",
new CslaConfigurationOptions());