Added validation and fixed errors
This commit is contained in:
		| @@ -1,4 +1,5 @@ | ||||
| using ApplicationLayer.Services.Applicants.Models; | ||||
| using ApplicationLayer.Services.AuthServices.Requests; | ||||
| using AutoMapper; | ||||
| using Domains.ApplicantDomain; | ||||
|  | ||||
| @@ -9,6 +10,11 @@ namespace Infrastructure.Automapper.Profiles | ||||
|         public ApplicantProfile() | ||||
|         { | ||||
|             CreateMap<Applicant, ApplicantModel>(MemberList.Destination); | ||||
|  | ||||
|             CreateMap<RegisterApplicantRequest, Applicant>(MemberList.Destination) | ||||
|                 .ForMember(a => a.UserId, opts => opts.Ignore()) | ||||
|                 .ForMember(a => a.Name, | ||||
|                     opts => opts.MapFrom(r => r.ApplicantName)); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,16 @@ | ||||
| using ApplicationLayer.Services.Applicants.Models; | ||||
| using AutoMapper; | ||||
| using Domains.ApplicantDomain; | ||||
|  | ||||
| namespace Infrastructure.Automapper.Profiles | ||||
| { | ||||
|     public class PlaceOfWorkProfile : Profile | ||||
|     { | ||||
|         public PlaceOfWorkProfile() | ||||
|         { | ||||
|             CreateMap<PlaceOfWorkModel, PlaceOfWork>(MemberList.Destination) | ||||
|                 .ForMember(p => p.Id, | ||||
|                     opts => opts.UseDestinationValue()); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -1,4 +1,4 @@ | ||||
| using ApplicationLayer.Services.AuthServices.Requests; | ||||
| using ApplicationLayer.Services.AuthServices.Common; | ||||
| using AutoMapper; | ||||
| using Domains.Users; | ||||
|  | ||||
| @@ -8,11 +8,7 @@ namespace Infrastructure.Automapper.Profiles | ||||
|     { | ||||
|         public UserProfile() | ||||
|         { | ||||
|             CreateMap<RegisterApplicantRequest, User>(MemberList.Destination) | ||||
|                 .ForMember(u => u.Role, | ||||
|                     opts => opts.Ignore()); | ||||
|  | ||||
|             CreateMap<RegisterRequest, User>() | ||||
|             CreateMap<AuthData, User>(MemberList.Destination) | ||||
|                 .ForMember(u => u.Role, | ||||
|                     opts => opts.Ignore()); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user