Files
schengen-visa/SchengenVisaApi/Infrastructure/Automapper/Profiles/ApplicantProfile.cs
2024-08-29 13:18:35 +03:00

23 lines
724 B
C#

using ApplicationLayer.Services.Applicants.Models;
using ApplicationLayer.Services.AuthServices.Requests;
using AutoMapper;
using Domains.ApplicantDomain;
namespace Infrastructure.Automapper.Profiles;
public class ApplicantProfile : Profile
{
public ApplicantProfile()
{
CreateMap<Applicant, ApplicantModel>(MemberList.Destination).ReverseMap();
CreateMap<RegisterApplicantRequest, Applicant>(MemberList.Destination)
.ForMember(a => a.UserId, opts => opts.Ignore())
.ForMember(a => a.Name,
opts => opts.MapFrom(r => r.ApplicantName));
CreateMap<NameModel, Name>().ReverseMap();
CreateMap<PassportModel, Passport>().ReverseMap();
}
}