Updates the geven TData instances in the C1 storage. If any property values in any of the TData instances, these would be saved into the storage. This method triggers the events OnBeforeUpdate and OnAfterUpdate for each item in items

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

Syntax

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

Parameters

items
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'TData>)>)>
The items to update in the C1 storage

Type Parameters

TData
An IData interface

Examples

CopyC#
using (DataConnection connection = new DataConnection())
{
   IEnumerable<IMyDataType> myDataTypes = 
      from d in connection.Get<IMyDataType>()
      where d.Value > 10
      select d;

   foreach (IMyDataType in myDataTypes)
   {
      myDataType.Value += 10;
   }   

   connection.Update<IMyDataType>(myDataTypes);
}

See Also