Browse Source

#1705 Add AddProfile method again.

pull/1710/head
Halil İbrahim Kalkan 7 years ago
parent
commit
e8a7e3ec9a
  1. 14
      framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperOptions.cs

14
framework/src/Volo.Abp.AutoMapper/Volo/Abp/AutoMapper/AbpAutoMapperOptions.cs

@ -40,6 +40,20 @@ namespace Volo.Abp.AutoMapper
}
}
public void AddProfile<TProfile>(bool validate = false)
where TProfile : Profile, new()
{
Configurators.Add(context =>
{
context.MapperConfiguration.AddProfile<TProfile>();
});
if (validate)
{
ValidateProfile(typeof(TProfile));
}
}
public void ValidateProfile<TProfile>(bool validate = true)
where TProfile : Profile
{

Loading…
Cancel
Save