Open Closed

When adding a member to organization unit, the user search cannot be made case insensitive #794


User avatar
0
michael.sudnik created
  • ABP Framework version: v4.1.0
  • UI type: MVC
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Seperated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:

Hi,

When we are wanting to search for a user, we are generally replacing the default module repositories with appropriate methods overriden to allow the filter text search to be case insensitive. We are changing the filter to perform a regex (MongoDB) search with the ignore case flag set (new BsonRegularExpression(Regex.Escape(filterText), "i");).

However, when we wanted to do this for the the MongoOrganizationUnitRepository, the ...Unadded... methods are not marked as virtual, so we are unable to override and change their behaviour. Our only option is to replace the whole repository and then make the changes. Could you make these methods virtual please?

Is it the intention that the filters in repositories are case sensitive? Is there a better way to change the search to be case insensitive without overriding each repository?

Mike

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
    michael.sudnik created

    There are also other repositories where the methods are not all marked as virtual, e.g. MongoIdentityRoleRepository

    Maybe you could add a unit test to detect and ensure that all public methods of any repository are overridable?

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

    Hello @michael.sudnik,

    Good idea, we may have missed that. Thanks for the advice!

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

    It will be fixed in the next release.

    Here is related PR about it.

    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 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.