mirror of https://github.com/abpframework/abp
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
761 B
23 lines
761 B
using AutoMapper;
|
|
using Volo.Abp.ObjectExtending.TestObjects;
|
|
|
|
namespace Volo.Abp.AutoMapper.SampleClasses
|
|
{
|
|
public class MyMapProfile : Profile
|
|
{
|
|
public MyMapProfile()
|
|
{
|
|
CreateMap<MyEntity, MyEntityDto>().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);
|
|
}
|
|
}
|
|
}
|