Blogs Hub

by AskGif | Mar 23, 2019 | Category :coding

How to Replace child collections in Entity Framework?

How to Replace child collections in Entity Framework?

ORMs are nice. Usually. That is until you hit a mostly unhelpful exception like “An object with the same key already exists in the ObjectStateManager”. I ran into this problem by trying to do a complete replacement of an entity’s child entity collection (i.e. a Products’s

read more...

by AskGif | Mar 21, 2019 | Category :coding

Best way to Update or Replace Entities in Entity Framework 6

Best way to Update or Replace Entities in Entity Framework 6

I’ve been working with Entity Framework for a few years and one pain-point for me was updating existing data entities. It typically ended up being tedious property replacement that made the code look nasty, and caused the risk of mismatching property assignments or missing a property assign

read more...