24 lines
765 B
C#
24 lines
765 B
C#
using AutoMapper;
|
|
using Npgsql;
|
|
using ProximaContracts.Domain.Rates.DTOs.Responses;
|
|
using ProximaContracts.Domain.Rates.Entities;
|
|
|
|
namespace ProximaContracts.Domain.Contracts.Mappings
|
|
{
|
|
public class RateProfile : Profile
|
|
{
|
|
public RateProfile()
|
|
{
|
|
#region Rates All
|
|
CreateMap<NpgsqlDataReader, RateEntity>()
|
|
.ForMember(d => d.Id, o => o.MapFrom(s => s.GetInt32(s.GetOrdinal("Id"))))
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => s.GetString(s.GetOrdinal("Name"))))
|
|
.ForMember(d => d.Price, o => o.MapFrom(r => r.GetDecimal(r.GetOrdinal("Price"))))
|
|
;
|
|
|
|
CreateMap<RateEntity, GetAllRatesDto>();
|
|
#endregion Rates All
|
|
}
|
|
}
|
|
}
|