最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Using a global query filter, how do you always filter out related entities that are softdeleted? - Stack Overflow

programmeradmin3浏览0评论

Suppose you have this in OnModelCreating

  builder.HasQueryFilter(p => !p.deleted && !p.SectionHeader.deleted);

It seems the code for the related entity here is always ignored when the sql is generated. Seems like there should be a way to block this if it doesn't work. Instead I get the following WHERE NOT (s.deleted) AND s.section_header_id = @__sectionHeaderId_0" if i try to search with the id of the deleted entity.

How would you always apply a query filter then to exclude a related entity if it is deleted?

发布评论

评论列表(0)

  1. 暂无评论