Dmitry Schetnikovich
Dmitry Schetnikovich

Reputation: 1782

Entity Framework. How to add object to collection in Unchanged state

How to add object to a collection so that after .SaveChanges() it hasn't inserted/updated?

Upvotes: 0

Views: 377

Answers (1)

Craig Stuntz
Craig Stuntz

Reputation: 126547

Use Attach instead of Add.

Upvotes: 2

Related Questions