Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IDbSetExtensions.AddOrUpdate Method

Entity Framework 5.0

Adds or updates entities by key when SaveChanges is called. Equivalent to an "upsert" operation from database terminology. This method can be useful when seeding data using Migrations.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Static member AddOrUpdate<TEntity>(IDbSet<TEntity>, TEntity[]) Adds or updates entities by key when SaveChanges is called. Equivalent to an "upsert" operation from database terminology. This method can be useful when seeding data using Migrations.
Public method Static member AddOrUpdate<TEntity>(IDbSet<TEntity>, Expression<Func<TEntity, Object>>, TEntity[]) Adds or updates entities by key when SaveChanges is called. Equivalent to an "upsert" operation from database terminology. This method can be useful when seeding data using Migrations.
Top
Show:
© 2015 Microsoft