put in the file auto mapping and change file.
change spelling too.
This commit is contained in:
@@ -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...*/
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user