Open Source Web Application Framework for ASP.NET Core
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.
 
 
 
 
 
 

23 lines
757 B

using AutoMapper;
using Volo.Abp.ObjectExtending.TestObjects;
namespace Volo.Abp.AutoMapper.SampleClasses;
public class MyMapProfile : Profile
{
public MyMapProfile()
{
CreateMap<MyEntity, MyEntityDto>().ReverseMap();
CreateMap<MyEnum, MyEnumDto>().ReverseMap();
CreateMap<ExtensibleTestPerson, ExtensibleTestPersonDto>()
.MapExtraProperties(ignoredProperties: new[] { "CityName" });
CreateMap<ExtensibleTestPerson, ExtensibleTestPersonWithRegularPropertiesDto>()
.ForMember(x => x.Name, y => y.Ignore())
.ForMember(x => x.Age, y => y.Ignore())
.ForMember(x => x.IsActive, y => y.Ignore())
.MapExtraProperties(mapToRegularProperties: true);
}
}