using AutoMapper; using Volo.Abp.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(); CreateMapPurchaseOrder(); CreateMapPurchaseOrderDetail(); CreateMapUnplannedReceipt(); } /// /// 零件实体与Dto映射 /// private void CreateMapPart() { CreateMap(); CreateMap() .Ignore(p=>p.Id) .Ignore(p=>p.CreatorId) .Ignore(p=>p.CreationTime); } /// /// 供应商实体与Dto相互映射 /// private void CreateMapSupplier() { CreateMap(); CreateMap() .Ignore(p => p.Id) .Ignore(p => p.CreatorId) .Ignore(p => p.CreationTime); } /// /// 收货单与退货单明细实体与Dto映射 /// private void CreateMapReceipt() { CreateMap(); CreateMap() .Ignore(p => p.Id) .Ignore(p => p.CreatorId) .Ignore(p => p.CreationTime); } /// /// 采购订单主表映射 /// private void CreateMapPurchaseOrder() { CreateMap(); CreateMap() .Ignore(p => p.Id) .Ignore(p => p.CreatorId) .Ignore(p => p.CreationTime); } /// /// 采购订单明细表映射 /// private void CreateMapPurchaseOrderDetail() { CreateMap(); CreateMap() .Ignore(p => p.Id) .Ignore(p => p.CreatorId) .Ignore(p => p.CreationTime); } private void CreateMapUnplannedReceipt() { CreateMap(); CreateMap() .Ignore(p => p.Id) .Ignore(p => p.CreatorId) .Ignore(p => p.CreationTime); } } }