When saving changes with SaveChanges
on a data context is there a way to determine which Entity causes an error? For example, sometimes I\'ll forget to assign a da
I think I might make separate calls to SaveChanges(). That is usually what I do for exactly this reason. Can I ask why you are saving multiple entities at a time? If you have to, I would follow the other guy's advice and validate the entities beforehand.
Or maybe there is a better way to structure your code so that in valid entiies won't even be attempted to be saved. Maybe detach your entities, and then run them through a validation method before attaching them to the new context. Hope that helps!