Open Closed

IDistrbitued EventHandler for UserEto does not have My cutom Properties #3087


User avatar
0
narinder@urvin.finance created
ABP Framework version: 5.2.1
UI type: Blazor server
DB provider: EF Core

Hi I have created some properties in Identity User and it is saving working. but In my other microservice i am handling its create/update event handler using UserEto. Now the issue is that event handling is working fine but it not giving my additional propteries because UserEto is implementing IuserData which has does not have my additional properties. please suggest how and where should i update the changes.


8 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    We will make UserEto class inherit IHasExtraProperties.

    https://github.com/abpframework/abp/pull/12597

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can also customize the ETO class.

    See https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#event-transfer-object

    https://github.com/abpframework/abp/blob/e499f40fc1e7f041def67b6bf8d30d5b337c4b54/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentityDomainModule.cs#L39 https://github.com/abpframework/abp/blob/e3e1779de6df5d26f01cdc8e99ac9cbcb3d24d3c/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDomainMappingProfile.cs#L10

  • User Avatar
    0
    narinder@urvin.finance created

    Do i need to add AbpIdentityDomainModule module in my project

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can configure it in the Identity microservice.

  • User Avatar
    0
    narinder@urvin.finance created

    Ok Thanks. let me try

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    ok

  • User Avatar
    0
    narinder@urvin.finance created

    Unable to create user after adding

       Configure<AbpDistributedEntityEventOptions>(options =>
        {
            options.EtoMappings.Add<IdentityUser, UserEto>(typeof(AbpIdentityDomainModule));
            //options.EtoMappings.Add<IdentityClaimType, IdentityClaimTypeEto>(typeof(AbpIdentityDomainModule));
            //options.EtoMappings.Add<IdentityRole, IdentityRoleEto>(typeof(AbpIdentityDomainModule));
            //options.EtoMappings.Add<OrganizationUnit, OrganizationUnitEto>(typeof(AbpIdentityDomainModule));
    
            options.AutoEventSelectors.Add<IdentityUser>();
            //options.AutoEventSelectors.Add<IdentityRole>();
        });
    

    This is giving error while creating user something related to method invocation

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    This is giving error while creating user something related to method invocation

    What's the error?

    You need to use YourUserEto that contains your custom properties,

    options.EtoMappings.Add<IdentityUser, YourUserEto>(typeof(AbpIdentityDomainModule));

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11