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.
 
 
 
 
 
 

29 lines
749 B

using System;
using System.Collections.Generic;
using AutoMapper;
namespace Volo.Abp.AutoMapper
{
public class AbpAutoMapAttribute : AbpAutoMapAttributeBase
{
public AbpAutoMapAttribute(params Type[] targetTypes)
: base(targetTypes)
{
}
public override void CreateMap(IMapperConfigurationExpression configuration, Type type)
{
if (TargetTypes.IsNullOrEmpty())
{
return;
}
foreach (var targetType in TargetTypes)
{
configuration.CreateMap(type, targetType, MemberList.Source);
configuration.CreateMap(targetType, type, MemberList.Destination);
}
}
}
}