Click or drag to resize

IDataApiMigrate Method

Migrate an Data Object with a specified ID. This method allows add or update a data object with a specified ID without using generated ID from system. Note: if canUpdateIfExist = false then the method will throw exception the specified ID already exits in DB

Namespace:  Casewhere.Runtime.DSL.Api
Assembly:  Casewhere.Runtime (in Casewhere.Runtime.dll) Version: 2.8.1.0
Syntax
C#
void Migrate(
	string id,
	Object data,
	bool canUpdateIfExist = false
)

Parameters

id
Type: SystemString
Id of the Data Object to be updated or added
data
Type: SystemObject
Data to be updated or added
canUpdateIfExist (Optional)
Type: SystemBoolean
canUpdateIfExist flag indicates whether to update the data object if it have already exist. Default value: false
Examples
var dataApi = ctx.Use<IDataApi>();
dataApi.Migrate(orderId, new 
{
    Total = 20,
    BillingAddress = "123 Sunset Blvd"
},
true);
See Also