Closed Stolzenberg closed 1 year ago
I just started using this Upsert operation and doing a POC. So, I might be wrong but in SQL you cannot have a IEnumerable as a direct column. You usually achieve this using FK and with one to many or many to many relationship, with navigation properties in the respective classes. As we know navigation properties usually are to get related objects. We cannot directly update or create them via upsert operation. As It internally uses Merge statement which works on a single target class per clause and doesn't recognize these virtual tables (navigation properties).
so, u might want to add an extension method or override of whenonmatched method to ur need.
Hello,
In my generic example here, I only want to add animals to a stable, but never remove any and I want to do this without a get call before.
Clearly as it is currently implemented, it overwrites the existing animals always, but even so it crashes in the reflection and does not find my collection of animals.
Error: