Gemstone Data Library
Show/Hide TOC

# TableOperationsTAddNewOrUpdateRecordAsync Method

Adds the specified modeled table record to the database if the record has not defined any of its primary key values; otherwise, the database will be updated with the specified modeled table record.

## Definition

Namespace: Gemstone.Data.Model
Assembly: Gemstone.Data (in Gemstone.Data.dll) Version: 1.0.155 -- Release Build+281e98d85719aca84ece1ddeed577cbcaddc8d0f
C#
View Source Request Example

    public Task<int> AddNewOrUpdateRecordAsync(
    	T record,
    	CancellationToken cancellationToken
    )

VB
View Source Request Example

    Public Function AddNewOrUpdateRecordAsync (
    	record As T,
    	cancellationToken As CancellationToken
    ) As Task(Of Integer)

C++
View Source Request Example

    public:
    Task<int>^ AddNewOrUpdateRecordAsync(
    	T record,
    	CancellationToken cancellationToken
    )

JavaScript
View Source Request Example

    function AddNewOrUpdateRecordAsync(record, cancellationToken);

#### Parameters

record T
  Record to add or update.
cancellationToken CancellationToken
  Propagates notification that operations should be canceled.

#### Return Value

TaskInt32
Number of rows affected.

## See Also

#### Reference

TableOperationsT Class
Gemstone.Data.Model Namespace