AddOrUpdate Method
Collapse the table of content
Expand the table of content

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:
© 2016 Microsoft