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.
74 lines
1.8 KiB
74 lines
1.8 KiB
3 years ago
|
using AutoMapper;
|
||
|
|
||
|
namespace Win_in.Sfs.Scp.WebApi
|
||
|
{
|
||
|
public class WebApiApplicationAutoMapperProfile : Profile
|
||
|
{
|
||
|
public WebApiApplicationAutoMapperProfile()
|
||
|
{
|
||
|
/* You can configure your AutoMapper mapping configuration here.
|
||
|
* Alternatively, you can split your mapping configurations
|
||
|
* into multiple profile classes for a better organization. */
|
||
|
|
||
|
CreateMapPart();
|
||
|
CreateMapSupplier();
|
||
|
CreateMapReceipt();
|
||
3 years ago
|
CreateMapPurchaseOrder();
|
||
|
CreateMapPurchaseOrderDetail();
|
||
3 years ago
|
CreateMapUnplannedReceipt();
|
||
3 years ago
|
}
|
||
|
|
||
|
/// <summary>
|
||
3 years ago
|
/// 零件实体与Dto映射
|
||
3 years ago
|
/// </summary>
|
||
|
private void CreateMapPart()
|
||
|
|
||
|
{
|
||
|
CreateMap<Part, PartDTO>().ReverseMap();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 供应商实体与Dto相互映射
|
||
|
/// </summary>
|
||
|
private void CreateMapSupplier()
|
||
|
|
||
|
{
|
||
|
CreateMap<Supplier, SupplierDTO>().ReverseMap();
|
||
|
}
|
||
|
|
||
3 years ago
|
|
||
3 years ago
|
/// <summary>
|
||
3 years ago
|
/// 收货单与退货单明细实体与Dto映射
|
||
3 years ago
|
/// </summary>
|
||
|
private void CreateMapReceipt()
|
||
|
|
||
|
{
|
||
|
CreateMap<Receipt, ReceiptDTO>().ReverseMap();
|
||
|
}
|
||
|
|
||
|
|
||
|
/// <summary>
|
||
|
/// 采购订单主表映射
|
||
|
/// </summary>
|
||
3 years ago
|
private void CreateMapPurchaseOrder()
|
||
3 years ago
|
|
||
|
{
|
||
3 years ago
|
CreateMap<PurchaseOrder, PurchaseOrderDTO>().ReverseMap();
|
||
3 years ago
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// 采购订单明细表映射
|
||
|
/// </summary>
|
||
3 years ago
|
private void CreateMapPurchaseOrderDetail()
|
||
3 years ago
|
|
||
|
{
|
||
3 years ago
|
CreateMap<PurchaseOrderDetail, PurchaseOrderDetailDTO>().ReverseMap();
|
||
3 years ago
|
}
|
||
3 years ago
|
|
||
|
private void CreateMapUnplannedReceipt()
|
||
|
{
|
||
|
CreateMap<UnplannedReceipt, UnplannedReceiptDTO>().ReverseMap();
|
||
|
}
|
||
3 years ago
|
}
|
||
3 years ago
|
}
|