Open Closed

How to add a custom data filter to a customer table based on a custom property in abpuser entity #1786


User avatar
0
nparejod created
  • ABP Framework version: v4.4.0
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

Hello,

I added a custom property to abpuser entity by followinf this link: https://community.abp.io/articles/how-to-add-custom-property-to-the-user-entity-6ggxiddr The name of the custom property is "CustomerId", I need to create a filter on entity "Customer" to show only records related to CustomerId of the current user.

I think this is a very commun request but I haven't figure out how to do this using abp commercial framework.

Is there a tutorial somewhere to do this?

Any help providing detailed information will be appreciated.

Thanks,

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

3 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi,

    Yes we can do that,

    You need store custom property as a table field. see https://docs.abp.io/en/abp/latest/Entities#how-is-it-stored

    For filter see https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.ef.property?view=efcore-5.0

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    nparejod created

    Maybe, I didn't ask the question properly. I need to make a custome property visible inside "CurrentUser" in order to use it as a filter. I need to know how to get information of a custome property in abpuser throught "IcurrentUser" to use as a filter.

    I was told that I need to add the information to a claim to be able to extract it using CurrentUser, is there a tutorial to do that?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    HI,

    Of course you can.

    See the unit tests, https://github.com/abpframework/abp/blob/48c52625f4c4df007f04d5ac6368b07411aa7521/modules/identity/test/Volo.Abp.Identity.Domain.Tests/Volo/Abp/Identity/AbpUserClaimsPrincipalFactory_Tests.cs#L45

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.