admin管理员组

文章数量:1321251

  • I have 2 tables, called Users and UserGroups.
  • The Users table has a global filter to only return users with a Status of 'Active'.
  • The UserGroups table has a global filter to only return groups with an Owner who is 'Active'.

If I want to return a list of active users with their associated user groups, this works fine.

Now I want to return the list of all users, including the groups they belong to, so I add .IgnoreQueryFilters() to my query, and this works, but it also returns the user groups where the Owner is 'Inactive'. So I have to manually add the UserGroup filtering back into my query, and if the global filter ever changes, I have to add that change manually to this query.

Is there a way to override the filters on Users, but not the filters on UserGroups?

本文标签: cIs it possible to override part of a global filter in EFStack Overflow