put in the file auto mapping and change file.

change spelling too.
This commit is contained in:
Kham
2021-12-10 11:30:30 +11:00
parent 87c89897c2
commit 52d2af93e2
7 changed files with 472 additions and 11 deletions
+27
View File
@@ -0,0 +1,27 @@
using AutoMapper;
using CarParkValidationAPI.Entities;
using CarParkValidationAPI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace CarParkValidationAPI.Datas
{
public class AutoMapping: Profile
{
public AutoMapping()
{
CreateMap<ConcessionType, ConcessionTypeDto>()
.ForMember( dest => dest.Id, opt => opt.MapFrom(src => src.ConcessionTypeID))
.ForMember(dest => dest.Description , opt=> opt.MapFrom(src=> src.ConcessionDesc))
.ForMember(dest => dest.Display, opt => opt.MapFrom(src => src.ConcessionDisplay))
.ReverseMap();
CreateMap<ValidationPoint, ValidationPointDto>()
.ForMember(dest => dest.Id , opt => opt.MapFrom(src => src.ValidationPointID))
.ForMember(dest => dest.Display, opt => opt.MapFrom(src => src.DisplayName))
.ReverseMap();
/*etc...*/
}
}
}