Compartilhar via


ObjectContextExtensions.AttachAsModified<T> Method (ObjectSet<T>, T, T)

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Attaches the specified entity as modified, with the specified original state.

Namespace:  System.ServiceModel.DomainServices.EntityFramework
Assembly:  System.ServiceModel.DomainServices.EntityFramework (in System.ServiceModel.DomainServices.EntityFramework.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Sub AttachAsModified(Of T As Class) ( _
    objectSet As ObjectSet(Of T), _
    current As T, _
    original As T _
)
'Usage
Dim objectSet As ObjectSet(Of T)
Dim current As T
Dim original As T

objectSet.AttachAsModified(current, _
    original)
public static void AttachAsModified<T>(
    this ObjectSet<T> objectSet,
    T current,
    T original
)
where T : class
[ExtensionAttribute]
public:
generic<typename T>
where T : ref class
static void AttachAsModified(
    ObjectSet<T>^ objectSet, 
    T current, 
    T original
)
static member AttachAsModified : 
        objectSet:ObjectSet<'T> * 
        current:'T * 
        original:'T -> unit  when 'T : not struct
JScript does not support generic types and methods.

Type Parameters

  • T
    The entity type.

Parameters

  • current
    Type: T
    The current entity state.
  • original
    Type: T
    The original entity state.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ObjectSet<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

Exceptions

Exception Condition
ArgumentNullException

objectSet, current, or original is nulla null reference (Nothing in Visual Basic).

See Also

Reference

ObjectContextExtensions Class

AttachAsModified Overload

System.ServiceModel.DomainServices.EntityFramework Namespace