inject MediatRLicense
This commit is contained in:
@@ -7,8 +7,11 @@ namespace WorkFlow.Application;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public static IServiceCollection AddWorkFlowServices(this IServiceCollection services)
|
||||
public static IServiceCollection AddWorkFlowServices(this IServiceCollection services, Action<DIOptions>? options = null)
|
||||
{
|
||||
DIOptions diOptions = new();
|
||||
options?.Invoke(diOptions);
|
||||
|
||||
services.AddAutoMapper(typeof(MappingProfile).Assembly);
|
||||
services.TryAddScoped<IConfigService, ConfigService>();
|
||||
services.TryAddScoped<IProfileControlsTFService, ProfileControlsTFService>();
|
||||
@@ -18,8 +21,14 @@ public static class DependencyInjection
|
||||
services.AddMediatR(cfg =>
|
||||
{
|
||||
cfg.RegisterServicesFromAssembly(typeof(DependencyInjection).Assembly);
|
||||
cfg.LicenseKey = diOptions.MediatRLicense;
|
||||
});
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
public class DIOptions
|
||||
{
|
||||
public string MediatRLicense { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user