Added mapper
This commit is contained in:
		| @@ -0,0 +1,14 @@ | ||||
| using ApplicationLayer.Services.Applicants.Models; | ||||
| using AutoMapper; | ||||
| using Domains.ApplicantDomain; | ||||
|  | ||||
| namespace Infrastructure.Automapper.Profiles | ||||
| { | ||||
|     public class ApplicantProfile : Profile | ||||
|     { | ||||
|         public ApplicantProfile() | ||||
|         { | ||||
|             CreateMap<Applicant, ApplicantModel>(MemberList.Destination); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,20 @@ | ||||
| using ApplicationLayer.Services.AuthServices.Requests; | ||||
| using AutoMapper; | ||||
| using Domains.Users; | ||||
|  | ||||
| namespace Infrastructure.Automapper.Profiles | ||||
| { | ||||
|     public class UserProfile : Profile | ||||
|     { | ||||
|         public UserProfile() | ||||
|         { | ||||
|             CreateMap<RegisterApplicantRequest, User>(MemberList.Destination) | ||||
|                 .ForMember(u => u.Role, | ||||
|                     opts => opts.Ignore()); | ||||
|  | ||||
|             CreateMap<RegisterRequest, User>() | ||||
|                 .ForMember(u => u.Role, | ||||
|                     opts => opts.Ignore()); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,25 @@ | ||||
| using ApplicationLayer.Services.VisaApplications.Models; | ||||
| using ApplicationLayer.Services.VisaApplications.Requests; | ||||
| using AutoMapper; | ||||
| using Domains.VisaApplicationDomain; | ||||
|  | ||||
| namespace Infrastructure.Automapper.Profiles | ||||
| { | ||||
|     public class VisaApplicationProfile : Profile | ||||
|     { | ||||
|         public VisaApplicationProfile() | ||||
|         { | ||||
|             CreateMap<VisaApplication, VisaApplicationModelForApplicant>(MemberList.Destination); | ||||
|  | ||||
|             CreateMap<VisaApplication, VisaApplicationModelForAuthority>(MemberList.Destination) | ||||
|                 .ForMember(model => model.Applicant, | ||||
|                     opts => opts.Ignore()); | ||||
|  | ||||
|             CreateMap<VisaApplicationCreateRequest, VisaApplication>(MemberList.Destination) | ||||
|                 .ForMember(va => va.RequestDate, | ||||
|                 opts => opts.Ignore()) | ||||
|                 .ForMember(va => va.ApplicantId, | ||||
|                 opts => opts.Ignore()); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user