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.
24 lines
663 B
24 lines
663 B
8 years ago
|
using Volo.Abp.DependencyInjection;
|
||
8 years ago
|
using Volo.Abp.ObjectMapping;
|
||
|
|
||
|
namespace Volo.Abp.AutoMapper.SampleClasses
|
||
|
{
|
||
|
public class MyEntityToMyEntityDto2Mapper : IObjectMapper<MyEntity, MyEntityDto2>, ITransientDependency
|
||
|
{
|
||
|
public MyEntityDto2 Map(MyEntity source)
|
||
|
{
|
||
|
return new MyEntityDto2
|
||
|
{
|
||
|
Id = source.Id,
|
||
|
Number = source.Number + 1
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public MyEntityDto2 Map(MyEntity source, MyEntityDto2 destination)
|
||
|
{
|
||
|
destination.Id = source.Id;
|
||
|
destination.Number = source.Number + 1;
|
||
|
return destination;
|
||
|
}
|
||
|
}
|
||
|
}
|