Add AutoMapper and MediatR; implement DtoMappingProfile
Added `AutoMapper` and `MediatR` NuGet packages to the `ReC.Application.csproj` file to include these libraries as dependencies. Created a `DtoMappingProfile` class in the `ReC.Application.Dto` namespace to define a mapping configuration between the `RecAction` entity and the `RecActionDto` data transfer object using `AutoMapper`. Included necessary `using` directives for `AutoMapper` and `ReC.Domain.Entities` in the `DtoMappingProfile.cs` file to enable the mapping functionality. These changes improve maintainability by automating object-to-object mapping and prepare the project for potential use of the mediator pattern with `MediatR`.
This commit is contained in:
12
src/ReC.Application/Dto/DtoMappingProfile.cs
Normal file
12
src/ReC.Application/Dto/DtoMappingProfile.cs
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
using AutoMapper;
|
||||||
|
using ReC.Domain.Entities;
|
||||||
|
|
||||||
|
namespace ReC.Application.Dto;
|
||||||
|
|
||||||
|
public class DtoMappingProfile : Profile
|
||||||
|
{
|
||||||
|
public DtoMappingProfile()
|
||||||
|
{
|
||||||
|
CreateMap<RecAction, RecActionDto>();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AutoMapper" Version="15.1.0" />
|
||||||
<PackageReference Include="MediatR" Version="13.1.0" />
|
<PackageReference Include="MediatR" Version="13.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user