Ends in:
1 DAY
5 HRS
31 MIN
20 SEC
Ends in:
1 D
5 H
31 M
20 S
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


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?

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Hello @michael.sudnik,

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

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    It will be fixed in the next release.

    Here is related PR about it.

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