DbContextExtensions.AttachAsModified<TEntity> Method (<TEntity>, TEntity, TEntity, )
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Attaches the specified entity as modified, with the specified original state.
Namespace: System.Web.Http.Data.EntityFramework
Assembly: System.Web.Http.Data.EntityFramework (in System.Web.Http.Data.EntityFramework.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Sub AttachAsModified(Of TEntity As Class) ( _
dbSet As DbSet(Of TEntity), _
current As TEntity, _
original As TEntity, _
dbContext As DbContext _
)
public static void AttachAsModified<TEntity>(
this DbSet<TEntity> dbSet,
TEntity current,
TEntity original,
DbContext dbContext
)
where TEntity : class
[ExtensionAttribute]
public:
generic<typename TEntity>
where TEntity : ref class
static void AttachAsModified(
DbSet<TEntity>^ dbSet,
TEntity current,
TEntity original,
DbContext^ dbContext
)
static member AttachAsModified :
dbSet:DbSet<'TEntity> *
current:'TEntity *
original:'TEntity *
dbContext:DbContext -> unit when 'TEntity : not struct
JScript does not support generic types or methods.
Type Parameters
- TEntity
The entity Type.
Parameters
- dbSet
Type: DbSet<TEntity>
The DbSet to attach to.
- current
Type: TEntity
The current entity.
- original
Type: TEntity
The original entity.
- dbContext
Type: DbContext
The corresponding DbContext.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type DbSet<TEntity>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).