Updates the given TData instance in the C1 storage. If any property values has been changed, these would be saved into the storage. This method triggers the events OnBeforeUpdate and OnAfterUpdate for the item item

Namespace: Composite.Data
Assembly: Composite (in Composite.dll) Version: 5.3.6135.33083

Syntax

C#
public void Update<TData>(
	TData item
)
where TData : class, IData
Visual Basic
Public Sub Update(Of TData As {Class, IData}) ( _
	item As TData _
)
Visual C++
public:
generic<typename TData>
where TData : ref class, IData
void Update(
	TData item
)

Parameters

item
Type: TData
The item to update in the C1 storage

Type Parameters

TData
An IData interface

Examples

CopyC#
using (DataConnection connection = new DataConnection())
{
   IMyDataType myDataType = 
      (from d in connection.Get<IMyDataType>()
       where d.Name == "Foo"
       select d).First();

   myDataType.Name = "Bar";

   connection.Update<IMyDataType>(myDataType);
}

See Also