Should set auto mapping context for ETOs.

Also, added missing dependency to AbpAutoMapperModule
pull/3210/head
Halil İbrahim Kalkan 6 years ago
parent 566ba43407
commit a8b6d93cb0

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
namespace Volo.Abp.Identity
{
@ -11,8 +10,6 @@ namespace Volo.Abp.Identity
public Guid? TenantId { get; set; }
public string Name { get; set; }
public string NormalizedName { get; set; }
public bool IsDefault { get; set; }

@ -13,22 +13,25 @@ namespace Volo.Abp.Identity
[DependsOn(
typeof(AbpDddDomainModule),
typeof(AbpIdentityDomainSharedModule),
typeof(AbpUsersDomainModule)
typeof(AbpUsersDomainModule),
typeof(AbpAutoMapperModule)
)]
public class AbpIdentityDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<AbpIdentityDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<IdentityDomainMappingProfile>();
options.AddProfile<IdentityDomainMappingProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<IdentityUser, UserEto>();
options.EtoMappings.Add<IdentityClaimType, IdentityClaimTypeEto>();
options.EtoMappings.Add<IdentityRole, IdentityRoleEto>();
options.EtoMappings.Add<IdentityClaimType, IdentityClaimTypeEto>(typeof(AbpIdentityDomainModule));
options.EtoMappings.Add<IdentityRole, IdentityRoleEto>(typeof(AbpIdentityDomainModule));
});
var identityBuilder = context.Services.AddAbpIdentity(options =>

Loading…
Cancel
Save