WorkFlow/WorkFlow.Application/DIExtensions.cs
Developer 02 1b21ccecf3 feat(DIExtensions): Methoden zur Injektion von Workflow-Diensten und mit TryAddScoped-Methode erstellt.
- Umwandlung von AddScoped in TryAddScoped in der Methode AddWorkFlowRepositories.
 - Methode mit dem Namen AddWorkFlow erstellt, um Dienste und Repositories zusammen hinzuzufügen
2024-10-23 17:42:19 +02:00

25 lines
1.0 KiB
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using WorkFlow.Application.Contracts;
using WorkFlow.Application.Services;
using WorkFlow.Infrastructure;
namespace WorkFlow.Application
{
public static class DIExtensions
{
public static IServiceCollection AddWorkFlowServices(this IServiceCollection services)
{
services.AddAutoMapper(typeof(MappingProfile).Assembly);
services.TryAddScoped<IConfigService, ConfigService>();
services.TryAddScoped<IProfileControlsTFService, ProfileControlsTFService>();
services.TryAddScoped<IProfileObjStateService, ProfileObjStateService>();
services.TryAddScoped<IProfileService, ProfileService>();
services.TryAddScoped<IStateService, StateService>();
return services;
}
public static IServiceCollection AddWorkFlow(this IServiceCollection services) => services.AddWorkFlowRepositories().AddWorkFlowServices();
}
}