Replaced direct service usage in CatalogsController with MediatR-based commands and queries for all CRUD operations. Added command/query and handler classes for Catalog operations. Updated dependency injection to register MediatR and removed ICatalogService. Improved code maintainability and testability by adopting CQRS architecture.
15 lines
400 B
C#
15 lines
400 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
using MediatR;
|
|
|
|
namespace DbFirst.Application;
|
|
|
|
public static class DependencyInjection
|
|
{
|
|
public static IServiceCollection AddApplication(this IServiceCollection services)
|
|
{
|
|
services.AddAutoMapper(typeof(DependencyInjection).Assembly);
|
|
services.AddMediatR(typeof(DependencyInjection).Assembly);
|
|
return services;
|
|
}
|
|
}
|