added validators in project

This commit is contained in:
2026-03-10 09:52:31 +01:00
parent 2e7b9e5154
commit 9f858df5f8
17 changed files with 558 additions and 188 deletions

View File

@@ -12,7 +12,13 @@ public class EntityToDtoMappings : Profile
{
public EntityToDtoMappings()
{
CreateMap<Book, GetBookDto>();
CreateMap<Book, GetBookDto>()
.ForMember(
dest => dest.AuthorFullName,
opt =>
opt.MapFrom(src =>
src.Author!.FirstName + " " + src.Author.LastName)
);
CreateMap<Book, GetBookDetailsDto>();
CreateMap<Author, GetAuthorDto>();