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
版权声明:本文标题:c# - Is it possible to override part of a global filter in EF? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742095063a2420495.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论