Method UpdateItemAsync
- Namespace
- Kepware.Api.ClientHandler
- Assembly
- Kepware.Api.dll
UpdateItemAsync<T>(T, T?, CancellationToken)
Updates an item in the Kepware server.
public Task<bool> UpdateItemAsync<T>(T item, T? oldItem = null, CancellationToken cancellationToken = default) where T : NamedEntity, new()
Parameters
item
TThe item to update.
oldItem
TThe old item.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- Task<bool>
A task that represents the asynchronous operation. The task result contains a boolean indicating whether the update was successful.
Type Parameters
T
The type of the item.
UpdateItemAsync<T>(string, T, T, CancellationToken)
protected Task<bool> UpdateItemAsync<T>(string endpoint, T item, T currentEntity, CancellationToken cancellationToken = default) where T : NamedEntity, new()
Parameters
endpoint
stringitem
TcurrentEntity
TcancellationToken
CancellationToken
Returns
Type Parameters
T
UpdateItemAsync<T, K>(K, K?, NamedEntity?, CancellationToken)
Updates an item in the Kepware server.
public Task<bool> UpdateItemAsync<T, K>(K item, K? oldItem = null, NamedEntity? owner = null, CancellationToken cancellationToken = default) where T : EntityCollection<K> where K : NamedEntity, new()
Parameters
item
KThe item to update.
oldItem
KThe old item.
owner
NamedEntityThe owner of the entities.
cancellationToken
CancellationTokenThe cancellation token.
Returns
Type Parameters
T
The type of the entity collection.
K
The type of the item.