Fixed map profile, added migration for services

This commit is contained in:
Richárd Kunkli
2020-10-25 16:52:39 +01:00
parent 1c61f5ec63
commit c837f592d0
6 changed files with 189 additions and 7 deletions

View File

@ -7,7 +7,10 @@ namespace Birdmap.API.MapperProfiles
{
public BirdmapProfile()
{
CreateMap<User, DTOs.AuthenticateResponse>().ReverseMap();
CreateMap<User, DTOs.AuthenticateResponse>()
.ForMember(m => m.Username, opt => opt.MapFrom(m => m.Name))
.ForMember(m => m.UserRole, opt => opt.MapFrom(m => m.Role))
.ReverseMap();
}
}
}