28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
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...*/
|
|
}
|
|
}
|
|
}
|