ISqlDataPersistenceService

ISqlDataPersistenceService in assembly SanteDB.Core.Api version 2.1.151.0

Summary

Represents a data persistence service where arbitrary SQL can be run

Properties

PropertyTypeAccessDescription

InvariantName

String

R

Text that identifies the type of database system that is running

Operations

OperationResponse/ReturnInput/ParameterDescription

ExecuteNonQuery

void

String sql

Executes the arbitrary SQL

Implementations

ADO.NET Data Persistence Service - (SanteDB.Persistence.Data.ADO)

Registers and configures the necessary sub-services and IDataPersistenceService implementations to allow SanteDB iCDR to persist, query, and read messages from available ADO.NET data providers

Description

This service is responsible for registering the necessary IDataPersistenceService providers which are responsible for interfacing the SanteDB Physical Model with the SanteDB Business / Object Model. Each persistence implementation is derived from the ModelMap configuration, and is uses the ADO.NET classes to via the IDbProvider configured.

Additionally, on start of the SanteDB iCDR or dCDR, this service is responsible for applying any Data Patches which have been provided (compiled via an embedded resource) by any of the validated SanteDB plugins.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Persistence.Data.ADO.Services.AdoPersistenceService, SanteDB.Persistence.Data.ADO, Version=2.1.151.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Services;
/// Other usings here
public class MySqlDataPersistenceService : SanteDB.Core.Services.ISqlDataPersistenceService { 
	public String ServiceName => "My own ISqlDataPersistenceService service";
	/// <summary>
	/// Text that identifies the type of database system that is running
	/// </summary>
	public String InvariantName {
		get;
	}
	/// <summary>
	/// Executes the arbitrary SQL
	/// </summary>
	public void ExecuteNonQuery(String sql){
		throw new System.NotImplementedException();
	}
}

References

Last updated