When I configure global filtering on an entity, it is officially recommended The corresponding navigation entity must also be configured again, written as follows:
Some entities in my project use soft deletion, but there is a one-to-one or one-to-many relationship between the soft-deleted entities and many other entities that are not soft-deleted. If you follow the configuration method of the document, it would be too much to configure them one by one. It’s troublesome and easy to miss. Is there a way to configure it in batches?
There's no in-the-box way to configure in batches. On the other hand, it shouldn't be that difficult to build some infrastructure yourself with little bit of reflection and some attribute.
The official document Global Query Filters link is as follows:
https://learn.microsoft.com/en-us/ef/core/querying/filters#accessing-entity-with-query-filter-using-required-navigation
When I configure global filtering on an entity, it is officially recommended The corresponding navigation entity must also be configured again, written as follows:
Some entities in my project use soft deletion, but there is a one-to-one or one-to-many relationship between the soft-deleted entities and many other entities that are not soft-deleted. If you follow the configuration method of the document, it would be too much to configure them one by one. It’s troublesome and easy to miss. Is there a way to configure it in batches?