Browse Source

Should set auto mapping context for ETOs.

Also, added missing dependency to AbpAutoMapperModule
pull/3210/head
Halil İbrahim Kalkan 7 years ago
parent
commit
a8b6d93cb0
  1. 3
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleEto.cs
  2. 11
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs

3
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IdentityRoleEto.cs

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

11
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs

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

Loading…
Cancel
Save