2020-10-24 23:23:22 +02:00
|
|
|
|
using AutoMapper;
|
|
|
|
|
using Birdmap.DAL.Entities;
|
|
|
|
|
|
|
|
|
|
namespace Birdmap.API.MapperProfiles
|
|
|
|
|
{
|
|
|
|
|
public class BirdmapProfile : Profile
|
|
|
|
|
{
|
|
|
|
|
public BirdmapProfile()
|
|
|
|
|
{
|
2020-10-25 16:52:39 +01:00
|
|
|
|
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();
|
2020-10-24 23:23:22 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|