Set ApplyToChildProperties(false) depending if it's a child property from a type which I can define.
Aventrue opened this issue · 4 comments
Is it possible to apply ApplyToChildProperties(false) depending of the type of the parent entity?
I'm not sure to understand,
By default when filtering, you can already specify the type.
Best Regards,
Jonathan
I want to set ApplyToChildProperties(false) just when the entity is loaded from a specific parent. As example, Entity A has multiple children of entity B. Entity C has also multiple children of entity B. Now I want to set ApplyToChildProperties(false) to entity B when it's an include load from entity A. But set ApplyToChildProperties(true) when it's loaded with include from entity C. How can I do that?
If you need to apply depending on a type, you can try SelectEntityTypeCondition
modelBuilder.Filter("ISomethingFilter", (ISomething t, int id) => t.ID < id, () => 5, o => o.SelectEntityTypeCondition(type => !typeof(IOtherthing).IsAssignableFrom(type)));
If you need to apply depending on value, there are no such options.
Let me know if that answer correctly to your question.
Best Regards,
Jonathan
Hello @jon,
This issue will be closed since it has been answered.
Feel free to reopen it if you feel otherwise.
Best Regards,
Jonathan