Click or drag to resize

IdentifiedDataPersistenceServiceTModel, TDbModelEnsureExistsTData Method

Ensure that the object exists in the database

Namespace: SanteDB.Persistence.Data.Services.Persistence
Assembly: SanteDB.Persistence.Data (in SanteDB.Persistence.Data.dll) Version: 3.0.2081-alpha+be3dca7062b437ed047a057127f85f12119224b9
Syntax
protected TData EnsureExists<TData>(
	DataContext context,
	TData data
)
where TData : new(), IdentifiedData

Parameters

context  DataContext
The context on which the exists statement should be performed
data  TData
The data which should be check for existence

Type Parameters

TData

[Missing <typeparam name="TData"/> documentation for "M:SanteDB.Persistence.Data.Services.Persistence.IdentifiedDataPersistenceService`2.EnsureExists``1(SanteDB.OrmLite.DataContext,``0)"]

Return Value

TData
The data as it exists in the database
Remarks
This method will return the current data in the database for data if it exists, otherwise it will create the object and then return the created object. This is used when for inserting dependent objects.
See Also