You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.7 KiB
49 lines
1.7 KiB
using AutoMapper;
|
|
using DealerSelection.WebApi.Models;
|
|
|
|
namespace DealerSelection.WebApi;
|
|
|
|
public static class MapperConfig
|
|
{
|
|
private static MapperConfiguration Config { get; set; }
|
|
|
|
public static void Register()
|
|
{
|
|
Config = new MapperConfiguration(
|
|
cfg =>
|
|
{
|
|
cfg.CreateMap<Api.Models.ModelDetail, ModelDetail>();
|
|
cfg.CreateMap<Api.Models.Response, Response>();
|
|
cfg.CreateMap<Api.Models.RefundApiResponse, RefundResponse>();
|
|
cfg.CreateMap<Api.Models.MulesoftResponse, MulesoftResponse>();
|
|
cfg.CreateMap<Api.Models.RefundStatusResponse, RefundStatusResponse>();
|
|
cfg.CreateMap<CustomerDealerInfoRequest, Api.Models.CustomerDealerInfoRequest>();
|
|
});
|
|
}
|
|
|
|
public static Response MapResponse(Api.Models.Response from)
|
|
{
|
|
return Config.CreateMapper().Map<Response>(from);
|
|
}
|
|
|
|
public static MulesoftResponse MapMulesoftResponse(Api.Models.MulesoftResponse from)
|
|
{
|
|
return Config.CreateMapper().Map<Api.Models.MulesoftResponse, MulesoftResponse>(from);
|
|
}
|
|
|
|
public static ModelDetail MapModelDetails(Api.Models.ModelDetail from)
|
|
{
|
|
return Config.CreateMapper().Map<ModelDetail>(from);
|
|
}
|
|
public static RefundResponse MapRefundResponse(Api.Models.RefundApiResponse from)
|
|
{
|
|
return Config.CreateMapper().Map<RefundResponse>(from);
|
|
}
|
|
|
|
|
|
public static Api.Models.CustomerDealerInfoRequest MapCustomerDealerInfoRequest(CustomerDealerInfoRequest from)
|
|
{
|
|
return Config.CreateMapper().Map<CustomerDealerInfoRequest, Api.Models.CustomerDealerInfoRequest>(from);
|
|
}
|
|
|
|
}
|