LinqDataAdapter
Overview
The LinqDataAdapter class is the base for both DA Linq Data Adapter classes: the LinqLocalDataAdapter class and the LinqRemoteDataAdapter class.
Please note that you cannot create instances of this class directly, because it is marked as abstract. You can use the LinqLocalDataAdapter or LinqRemoteDataAdapter classes instead.
The LinqDataAdapter class provides a unified interface for both Local and Remote Data Adapters, thus allowing to use the same code to perform DA Linq requests using both local and remote access to the Data Abstract data services.
The following example demonstrates a Linq query where the dataAdapter is an instance of the LinqRemoteDataAdapter class:
var linqQuery = from emp in dataAdapter.GetTable<Worker>()
select emp;
Location
- Reference: RemObjects.DataAbstract.dll
- Namespace: RemObjects.DataAbstract.Linq
- Ancestry: BaseComponent | BaseDataAdapter | LinqDataAdapter
constructor protected
Creates a new instance of the LinqDataAdapter class. This constructor can be called only from constructors of inherited classes.
constructor
LinqDataAdapter()
Sub New()
constructor (Boolean) protected
constructor(avoidLicenseCheck: Boolean)
LinqDataAdapter(Boolean avoidLicenseCheck)
Sub New(avoidLicenseCheck As Boolean)
Parameters:
- avoidLicenseCheck:
constructor (IContainer) protected
constructor(container: IContainer)
LinqDataAdapter(IContainer container)
Sub New(container As IContainer)
Parameters:
- container:
AcceptChangesDuringFill (declared in BaseDataAdapter)
Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.
The default value is true.
property AcceptChangesDuringFill: Boolean read write;
Boolean AcceptChangesDuringFill { get; set; }
Property AcceptChangesDuringFill() As Boolean
AcceptChangesDuringUpdate (declared in BaseDataAdapter)
Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.
The default value is true.
property AcceptChangesDuringUpdate: Boolean read write;
Boolean AcceptChangesDuringUpdate { get; set; }
Property AcceptChangesDuringUpdate() As Boolean
ApplyChanges
Applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method ApplyChanges
void ApplyChanges()
Sub ApplyChanges()
AutoLoadScripts (declared in BaseDataAdapter)
Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.
property AutoLoadScripts: Boolean read write;
Boolean AutoLoadScripts { get; set; }
Property AutoLoadScripts() As Boolean
BeginApplyChanges
Asyncronously applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method BeginApplyChanges(cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginApplyChanges(AsyncCallback cb, Object state)
Function BeginApplyChanges(cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- cb: Callback method that will be called once the update process is done.
- state: State information about the asynchronous operation.
BeginExecute
Asynchronously executes the provided queries. Basically, this is the only way to execute a DA Linq query in a Silverlight application.
This code sample demonstrates how data is retrieved in a Silverlight application (code snippet from the Silverlight sample shipped with DataAbstract for .NET):
var q = (from x in linqRemoteDataAdapter.GetTable<Products>() select x);
IQueryable[] Queries = new IQueryable[] { q };
linqRemoteDataAdapter.BeginExecute(
Queries,
delegate(IAsyncResult ar)
{
linqRemoteDataAdapter.EndExecute(ar);
Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), q.ToList<Products>());
},
null);
method BeginExecute(query: array of IQueryable; callback: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginExecute(IQueryable[] query, AsyncCallback callback, Object state)
Function BeginExecute(query As IQueryable(), callback As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- query: Array of IQueryable objects representing DA Linq queries.
- callback:
- state: State information about the asynchronous operation.
BeginFetchData protected
method BeginFetchData(tableRequest: array of TableRequestInfo; tableNames: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>; callback: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginFetchData(TableRequestInfo[] tableRequest, String[] tableNames, Action<Int32, array of Int32, IDataReader> fillMethod, AsyncCallback callback, Object state)
Function BeginFetchData(tableRequest As TableRequestInfo(), tableNames As String(), fillMethod As Action (Of Int32, Int32(), IDataReader), callback As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- tableRequest:
- tableNames:
- fillMethod:
- callback:
- state:
BeginInit (declared in BaseDataAdapter)
method BeginInit
void BeginInit()
Sub BeginInit()
BeginInternalUpdate protected (declared in BaseDataAdapter)
Starts asynchronous data update operation.
method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)
Function BeginInternalUpdate(deltas As Delta(), cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- deltas: Collection of Delta instances that will be send to the Data Abstract server
- cb: Callback method that will be called once the asynchronous data update call is completed
- state: Asynchronous operation state object
CacheSchema (declared in BaseDataAdapter)
Gets or sets flag indicating whether Schema retrieved from the server via the BaseDataAdapter method call should be chached in the BaseDataAdapter property. Setting this property to false can significantly decrease performance.
The default value is true.
property CacheSchema: Boolean read write;
Boolean CacheSchema { get; set; }
Property CacheSchema() As Boolean
CancelChanges
Clears changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method CancelChanges
void CancelChanges()
Sub CancelChanges()
CheckAdapterSettings protected (declared in BaseDataAdapter)
Performs required internal data adapter initialization before issuing a data read or update request.
method CheckAdapterSettings
void CheckAdapterSettings()
Sub CheckAdapterSettings()
CheckFailures protected (declared in BaseDataAdapter)
Composes the data update failure message based on the Delta information returned from the server after the Udate call.
method CheckFailures(aDelta: Delta; aChanges: List<DeltaChange>; aFailureMessage: StringBuilder)
void CheckFailures(Delta aDelta, List<DeltaChange> aChanges, StringBuilder aFailureMessage)
Sub CheckFailures(aDelta As Delta, aChanges As List<DeltaChange>, aFailureMessage As StringBuilder)
Parameters:
- aDelta: Delta instance returned from the Data Abstract server
- aChanges: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
- aFailureMessage: String builder instace that will contain composed data update failure message
ClearAsyncResults
method ClearAsyncResults
void ClearAsyncResults()
Sub ClearAsyncResults()
CloneTable<T>
method CloneTable<T>(source: T): T
T CloneTable<T>(T source)
Function CloneTable<T>(source As T) As T
Parameters:
- source:
CompareBytes
class method CompareBytes(a: array of Byte; b: array of Byte): Boolean
static Boolean CompareBytes(Byte[] a, Byte[] b)
Shared Function CompareBytes(a As Byte(), b As Byte()) As Boolean
Parameters:
- a:
- b:
DeleteRow<T>
method DeleteRow<T>(data: T): DeltaChange
DeltaChange DeleteRow<T>(T data)
Function DeleteRow<T>(data As T) As DeltaChange
Parameters:
- data:
DynamicSelect (declared in BaseDataAdapter)
Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { get; set; }
Property DynamicSelect() As Boolean
EndApplyChanges
Ends an asynchronous remote database update.
method EndApplyChanges(ar: IAsyncResult)
void EndApplyChanges(IAsyncResult ar)
Sub EndApplyChanges(ar As IAsyncResult)
Parameters:
- ar: The pending asynchronous data update operation.
EndExecute
Ends an asynchronous query request to a data service.
method EndExecute(ar: IAsyncResult)
void EndExecute(IAsyncResult ar)
Sub EndExecute(ar As IAsyncResult)
Parameters:
- ar: The pending asynchronous query request.
EndFetchData protected
method EndFetchData(ar: IAsyncResult)
void EndFetchData(IAsyncResult ar)
Sub EndFetchData(ar As IAsyncResult)
Parameters:
- ar:
EndInit (declared in BaseDataAdapter)
method EndInit
void EndInit()
Sub EndInit()
EndInternalUpdate protected (declared in BaseDataAdapter)
Finishes the asynchronous data update operation and performs needed cleanup actions, f.e. merges back updated AutoInc values retrieved from the server.
method EndInternalUpdate(ar: IAsyncResult)
void EndInternalUpdate(IAsyncResult ar)
Sub EndInternalUpdate(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
EnterCriticalSection protected (declared in BaseDataAdapter)
This method is called on entering a method or code region that should be accessed by a single thread only at any given moment of time.
If a thread calls this method while such method is being executed then the calling thread will be paused until the critical code section is released by the blocking thread.
method EnterCriticalSection(status: DataAdapterStatus)
void EnterCriticalSection(DataAdapterStatus status)
Sub EnterCriticalSection(status As DataAdapterStatus)
Parameters:
- status: Value that should be assigned to the BaseDataAdapter property until the critical code section is exited
Execute (String): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String): Int32
Int32 Execute(String commandName)
Function Execute(commandName As String) As Int32
Parameters:
- commandName:
Execute (String, array of Object, DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; inputParameters: array of Object; out outputParameterts: DataParameter): Int32
Int32 Execute(String commandName, Object[] inputParameters, out DataParameter outputParameterts)
Function Execute(commandName As String, inputParameters As Object(), <OutAttribute> ByRef outputParameterts As DataParameter) As Int32
Parameters:
- commandName:
- inputParameters:
- outputParameterts:
Execute (String, array of DataParameter, DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; inputParameters: array of DataParameter; out outputParameterts: DataParameter): Int32
Int32 Execute(String commandName, DataParameter[] inputParameters, out DataParameter outputParameterts)
Function Execute(commandName As String, inputParameters As DataParameter(), <OutAttribute> ByRef outputParameterts As DataParameter) As Int32
Parameters:
- commandName:
- inputParameters:
- outputParameterts:
Execute (String, array of Object): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; params inputParameters: array of Object): Int32
Int32 Execute(String commandName, params Object[] inputParameters)
Function Execute(commandName As String, ParamArray inputParameters As Object()) As Int32
Parameters:
- commandName:
- inputParameters:
Execute (String, array of DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; params inputParameters: array of DataParameter): Int32
Int32 Execute(String commandName, params DataParameter[] inputParameters)
Function Execute(commandName As String, ParamArray inputParameters As DataParameter()) As Int32
Parameters:
- commandName:
- inputParameters:
Execute (array of IQueryable): array of Object
method Execute(query: array of IQueryable): array of Object
Object[] Execute(IQueryable[] query)
Function Execute(query As IQueryable()) As Object()
Parameters:
- query:
ExitCriticalSection protected (declared in BaseDataAdapter)
This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.
This method sets the BaseDataAdapter property to RemoteAdapterStatus.Idle and then releases the critical code section lock.
method ExitCriticalSection
void ExitCriticalSection()
Sub ExitCriticalSection()
FailureBehavior (declared in BaseDataAdapter)
Gets or sets intended Data Adapter behavior on data update errors.
property FailureBehavior: FailureBehavior read write;
FailureBehavior FailureBehavior { get; set; }
Property FailureBehavior() As FailureBehavior
FetchData protected
method FetchData(request: array of TableRequestInfo; tableName: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>)
void FetchData(TableRequestInfo[] request, String[] tableName, Action<Int32, array of Int32, IDataReader> fillMethod)
Sub FetchData(request As TableRequestInfo(), tableName As String(), fillMethod As Action (Of Int32, Int32(), IDataReader))
Parameters:
- request:
- tableName:
- fillMethod:
FlushSchema (declared in BaseDataAdapter)
Cleans up the Schema cache and sets the BaseDataAdapter to null.
method FlushSchema
void FlushSchema()
Sub FlushSchema()
GetPendingDeltas protected
method GetPendingDeltas: array of Delta
Delta[] GetPendingDeltas()
Function GetPendingDeltas() As Delta()
GetSchemaOnFirstFill (declared in BaseDataAdapter)
Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.
The default value is true.
property GetSchemaOnFirstFill: Boolean read write;
Boolean GetSchemaOnFirstFill { get; set; }
Property GetSchemaOnFirstFill() As Boolean
GetTable<T>
method GetTable<T>: RemoteTable<T>
RemoteTable<T> GetTable<T>()
Function GetTable<T>() As RemoteTable<T>
GetTable<T> (array of Object): RemoteTableQuery<T>
method GetTable<T>(params parameters: array of Object): RemoteTableQuery<T>
RemoteTableQuery<T> GetTable<T>(params Object[] parameters)
Function GetTable<T>(ParamArray parameters As Object()) As RemoteTableQuery<T>
Parameters:
- parameters:
GetTable<T> (array of DataParameter): RemoteTableQuery<T>
method GetTable<T>(params parameters: array of DataParameter): RemoteTableQuery<T>
RemoteTableQuery<T> GetTable<T>(params DataParameter[] parameters)
Function GetTable<T>(ParamArray parameters As DataParameter()) As RemoteTableQuery<T>
Parameters:
- parameters:
InitScriptProvider
method InitScriptProvider: Boolean
Boolean InitScriptProvider()
Function InitScriptProvider() As Boolean
InsertRow<T>
method InsertRow<T>(data: T): DeltaChange
DeltaChange InsertRow<T>(T data)
Function InsertRow<T>(data As T) As DeltaChange
Parameters:
- data:
LoadScripts (declared in BaseDataAdapter)
Downloads Business Rules Scripting API scripts from the server.
In its current implementation this method downloads entire Schema from the Data Abstract server.
method LoadScripts
void LoadScripts()
Sub LoadScripts()
NewRow<T>
method NewRow<T>: T
T NewRow<T>()
Function NewRow<T>() As T
OnApplyChanges
This event is fired before any data changes are sent to the DataAbstract server. It can be used to perform data validation, changes logging, etc.
event OnApplyChanges: EventHandler;
delegate EventHandler OnApplyChanges()
Event OnApplyChanges As EventHandler
ProcessPendingChangeDeltas protected
method ProcessPendingChangeDeltas(serverDeltas: array of Delta; originalDeltaChangeIds: IDictionary<String, array of Int32>)
void ProcessPendingChangeDeltas(Delta[] serverDeltas, IDictionary<String, array of Int32> originalDeltaChangeIds)
Sub ProcessPendingChangeDeltas(serverDeltas As Delta(), originalDeltaChangeIds As IDictionary<String, array of Int32>)
Parameters:
- serverDeltas:
- originalDeltaChangeIds:
ReadSchema (declared in BaseDataAdapter)
Downloads the Schema from the Data Abstract server .
method ReadSchema(forceRefresh: Boolean): Schema
Schema ReadSchema(Boolean forceRefresh)
Function ReadSchema(forceRefresh As Boolean) As Schema
Parameters:
- forceRefresh: Flag indicating whether Schema should be downloaded even if the Schema is already cached in the Schema property
ReadStreamerSchema protected (declared in BaseDataAdapter)
Downloads the Schema from the Data Abstract server. This method is used when the server exposes the Schema using method that sends it using highly-optimized binary stream (opposing to the BaseDataAdapter method that is called when the server exposes its Schema as Xml).
method ReadStreamerSchema: Binary
Binary ReadStreamerSchema()
Function ReadStreamerSchema() As Binary
RemoveAsyncResult
method RemoveAsyncResult(query: IQueryable)
void RemoveAsyncResult(IQueryable query)
Sub RemoveAsyncResult(query As IQueryable)
Parameters:
- query:
Schema (declared in BaseDataAdapter)
Gets the Schema currently cached by the Data Adapter instance
property Schema: Schema read;
Schema Schema { get; }
ReadOnly Property Schema() As Schema
ScriptProvider (declared in BaseDataAdapter)
Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.
property ScriptProvider: IScriptProvider read write;
IScriptProvider ScriptProvider { get; set; }
Property ScriptProvider() As IScriptProvider
Status (declared in BaseDataAdapter)
Gets current status of the Data Adapter
property Status: DataAdapterStatus read;
DataAdapterStatus Status { get; }
ReadOnly Property Status() As DataAdapterStatus
ThrowFailures protected
This method is called at the end of the ApplyChanges method. It throws a DAUpdatesFailedException if the provided aChanges list is not empty (which means that some DeltaChanges were not processed successfully) and the FailureBehavior property is set to FailureBehavior.RaiseException or FailureBehavior.Both.
method ThrowFailures(changes: List<DeltaChange>; failureMessage: String)
void ThrowFailures(List<DeltaChange> changes, String failureMessage)
Sub ThrowFailures(changes As List<DeltaChange>, failureMessage As String)
Parameters:
- changes:
- failureMessage:
TriggerApplyChanges protected
method TriggerApplyChanges
void TriggerApplyChanges()
Sub TriggerApplyChanges()
UpdateRow<T> (T): DeltaChange
method UpdateRow<T>(data: T): DeltaChange
DeltaChange UpdateRow<T>(T data)
Function UpdateRow<T>(data As T) As DeltaChange
Parameters:
- data:
UpdateRow<T> (T, T): DeltaChange
method UpdateRow<T>(originalData: T; newData: T): DeltaChange
DeltaChange UpdateRow<T>(T originalData, T newData)
Function UpdateRow<T>(originalData As T, newData As T) As DeltaChange
Parameters:
- originalData:
- newData:
UseBindableClass
Defines which type will be used as the base type for query result representation: the ordinary System.Collections.Generic.List class (which will be used if this property is set to false) or the more advanced DABindingList class.
The default value of this property is true.
Yuo can set this property to false if you just want to retrieve data, but do not need the advanced binding capabilities of the DABindingList class.
property UseBindableClass: Boolean read write;
Boolean UseBindableClass { get; set; }
Property UseBindableClass() As Boolean
UseDynamicWhere
Defines how the data will be retrieved from the DataAbstract server. If this property is set to true, Dynamic Where will be used. If set to false, the more advanced DA SQL approach will be used (note that this approach is not compatible with Delphi-based DataAbstract servers).
The default value of this property is true for assemblies for the full .NET and the .NET Compact Frameworks, false for the Silverlight version of DataAbstract for .NET.
Note: If your client application is intended to be used only with .NET-based Data Abstract servers, the recommended value of this property is false, because some Linq operators cannot be represented with Dynamic Where conditions.
property UseDynamicWhere: Boolean read write;
Boolean UseDynamicWhere { get; set; }
Property UseDynamicWhere() As Boolean
AcceptChangesDuringFill (declared in BaseDataAdapter)
Gets or sets a flag indicating whether all target DataTable changes made during data retrieval from the Data Abstract server should be commited. If this property is set to false then some or all data rows in the target DataTable will be marked as updated or inserted after the Fill operation is completed.
The default value is true.
property AcceptChangesDuringFill: Boolean read write;
Boolean AcceptChangesDuringFill { get; set; }
Property AcceptChangesDuringFill() As Boolean
AcceptChangesDuringUpdate (declared in BaseDataAdapter)
Gets or sets a flag indicating whether all DataTable changes should be automatically commited after the update data is sent to the Data Abstract server should be commited. If this property is set to false then data rows in the target DataTable will remain to be marked as updated or inserted after the Update operation is completed.
The default value is true.
property AcceptChangesDuringUpdate: Boolean read write;
Boolean AcceptChangesDuringUpdate { get; set; }
Property AcceptChangesDuringUpdate() As Boolean
AutoLoadScripts (declared in BaseDataAdapter)
Gets or sets flag indicating whether Business Rules Scripting API scripts should be automaically downloaded from the Data Abstract server when the data is retreved from the server.
property AutoLoadScripts: Boolean read write;
Boolean AutoLoadScripts { get; set; }
Property AutoLoadScripts() As Boolean
CacheSchema (declared in BaseDataAdapter)
Gets or sets flag indicating whether Schema retrieved from the server via the BaseDataAdapter method call should be chached in the BaseDataAdapter property. Setting this property to false can significantly decrease performance.
The default value is true.
property CacheSchema: Boolean read write;
Boolean CacheSchema { get; set; }
Property CacheSchema() As Boolean
DynamicSelect (declared in BaseDataAdapter)
Gets or sets a flag indicating whether Data Adapter should perform queries using the Dynamic Select feature
property DynamicSelect: Boolean read write;
Boolean DynamicSelect { get; set; }
Property DynamicSelect() As Boolean
FailureBehavior (declared in BaseDataAdapter)
Gets or sets intended Data Adapter behavior on data update errors.
property FailureBehavior: FailureBehavior read write;
FailureBehavior FailureBehavior { get; set; }
Property FailureBehavior() As FailureBehavior
GetSchemaOnFirstFill (declared in BaseDataAdapter)
Gets or sets a flag indicating whether Schema should be downloaded from the remote Data Abstract server right before the first data request.
The default value is true.
property GetSchemaOnFirstFill: Boolean read write;
Boolean GetSchemaOnFirstFill { get; set; }
Property GetSchemaOnFirstFill() As Boolean
Schema (declared in BaseDataAdapter)
Gets the Schema currently cached by the Data Adapter instance
property Schema: Schema read;
Schema Schema { get; }
ReadOnly Property Schema() As Schema
ScriptProvider (declared in BaseDataAdapter)
Gets or sets Business Rules Scripting API provided that will be used to execute client-side scripts.
property ScriptProvider: IScriptProvider read write;
IScriptProvider ScriptProvider { get; set; }
Property ScriptProvider() As IScriptProvider
Status (declared in BaseDataAdapter)
Gets current status of the Data Adapter
property Status: DataAdapterStatus read;
DataAdapterStatus Status { get; }
ReadOnly Property Status() As DataAdapterStatus
UseBindableClass
Defines which type will be used as the base type for query result representation: the ordinary System.Collections.Generic.List class (which will be used if this property is set to false) or the more advanced DABindingList class.
The default value of this property is true.
Yuo can set this property to false if you just want to retrieve data, but do not need the advanced binding capabilities of the DABindingList class.
property UseBindableClass: Boolean read write;
Boolean UseBindableClass { get; set; }
Property UseBindableClass() As Boolean
UseDynamicWhere
Defines how the data will be retrieved from the DataAbstract server. If this property is set to true, Dynamic Where will be used. If set to false, the more advanced DA SQL approach will be used (note that this approach is not compatible with Delphi-based DataAbstract servers).
The default value of this property is true for assemblies for the full .NET and the .NET Compact Frameworks, false for the Silverlight version of DataAbstract for .NET.
Note: If your client application is intended to be used only with .NET-based Data Abstract servers, the recommended value of this property is false, because some Linq operators cannot be represented with Dynamic Where conditions.
property UseDynamicWhere: Boolean read write;
Boolean UseDynamicWhere { get; set; }
Property UseDynamicWhere() As Boolean
CompareBytes
class method CompareBytes(a: array of Byte; b: array of Byte): Boolean
static Boolean CompareBytes(Byte[] a, Byte[] b)
Shared Function CompareBytes(a As Byte(), b As Byte()) As Boolean
Parameters:
- a:
- b:
constructor protected
Creates a new instance of the LinqDataAdapter class. This constructor can be called only from constructors of inherited classes.
constructor
LinqDataAdapter()
Sub New()
constructor (Boolean) protected
constructor(avoidLicenseCheck: Boolean)
LinqDataAdapter(Boolean avoidLicenseCheck)
Sub New(avoidLicenseCheck As Boolean)
Parameters:
- avoidLicenseCheck:
constructor (IContainer) protected
constructor(container: IContainer)
LinqDataAdapter(IContainer container)
Sub New(container As IContainer)
Parameters:
- container:
ApplyChanges
Applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method ApplyChanges
void ApplyChanges()
Sub ApplyChanges()
BeginApplyChanges
Asyncronously applies changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method BeginApplyChanges(cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginApplyChanges(AsyncCallback cb, Object state)
Function BeginApplyChanges(cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- cb: Callback method that will be called once the update process is done.
- state: State information about the asynchronous operation.
BeginExecute
Asynchronously executes the provided queries. Basically, this is the only way to execute a DA Linq query in a Silverlight application.
This code sample demonstrates how data is retrieved in a Silverlight application (code snippet from the Silverlight sample shipped with DataAbstract for .NET):
var q = (from x in linqRemoteDataAdapter.GetTable<Products>() select x);
IQueryable[] Queries = new IQueryable[] { q };
linqRemoteDataAdapter.BeginExecute(
Queries,
delegate(IAsyncResult ar)
{
linqRemoteDataAdapter.EndExecute(ar);
Dispatcher.BeginInvoke(new ProcessSelectProductsResultCb(ProcessSelectProductsResult), q.ToList<Products>());
},
null);
method BeginExecute(query: array of IQueryable; callback: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginExecute(IQueryable[] query, AsyncCallback callback, Object state)
Function BeginExecute(query As IQueryable(), callback As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- query: Array of IQueryable objects representing DA Linq queries.
- callback:
- state: State information about the asynchronous operation.
BeginFetchData protected
method BeginFetchData(tableRequest: array of TableRequestInfo; tableNames: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>; callback: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginFetchData(TableRequestInfo[] tableRequest, String[] tableNames, Action<Int32, array of Int32, IDataReader> fillMethod, AsyncCallback callback, Object state)
Function BeginFetchData(tableRequest As TableRequestInfo(), tableNames As String(), fillMethod As Action (Of Int32, Int32(), IDataReader), callback As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- tableRequest:
- tableNames:
- fillMethod:
- callback:
- state:
BeginInit (declared in BaseDataAdapter)
method BeginInit
void BeginInit()
Sub BeginInit()
BeginInternalUpdate protected (declared in BaseDataAdapter)
Starts asynchronous data update operation.
method BeginInternalUpdate(deltas: array of Delta; cb: AsyncCallback; state: Object): IAsyncResult
IAsyncResult BeginInternalUpdate(Delta[] deltas, AsyncCallback cb, Object state)
Function BeginInternalUpdate(deltas As Delta(), cb As AsyncCallback, state As Object) As IAsyncResult
Parameters:
- deltas: Collection of Delta instances that will be send to the Data Abstract server
- cb: Callback method that will be called once the asynchronous data update call is completed
- state: Asynchronous operation state object
CancelChanges
Clears changes made to all RemoteTable instances retrieved via this LinqDataAdapter instance.
method CancelChanges
void CancelChanges()
Sub CancelChanges()
CheckAdapterSettings protected (declared in BaseDataAdapter)
Performs required internal data adapter initialization before issuing a data read or update request.
method CheckAdapterSettings
void CheckAdapterSettings()
Sub CheckAdapterSettings()
CheckFailures protected (declared in BaseDataAdapter)
Composes the data update failure message based on the Delta information returned from the server after the Udate call.
method CheckFailures(aDelta: Delta; aChanges: List<DeltaChange>; aFailureMessage: StringBuilder)
void CheckFailures(Delta aDelta, List<DeltaChange> aChanges, StringBuilder aFailureMessage)
Sub CheckFailures(aDelta As Delta, aChanges As List<DeltaChange>, aFailureMessage As StringBuilder)
Parameters:
- aDelta: Delta instance returned from the Data Abstract server
- aChanges: Collection that will contain a list of the DeltaChange instances that server marked as ChangeStatus
- aFailureMessage: String builder instace that will contain composed data update failure message
ClearAsyncResults
method ClearAsyncResults
void ClearAsyncResults()
Sub ClearAsyncResults()
CloneTable<T>
method CloneTable<T>(source: T): T
T CloneTable<T>(T source)
Function CloneTable<T>(source As T) As T
Parameters:
- source:
DeleteRow<T>
method DeleteRow<T>(data: T): DeltaChange
DeltaChange DeleteRow<T>(T data)
Function DeleteRow<T>(data As T) As DeltaChange
Parameters:
- data:
EndApplyChanges
Ends an asynchronous remote database update.
method EndApplyChanges(ar: IAsyncResult)
void EndApplyChanges(IAsyncResult ar)
Sub EndApplyChanges(ar As IAsyncResult)
Parameters:
- ar: The pending asynchronous data update operation.
EndExecute
Ends an asynchronous query request to a data service.
method EndExecute(ar: IAsyncResult)
void EndExecute(IAsyncResult ar)
Sub EndExecute(ar As IAsyncResult)
Parameters:
- ar: The pending asynchronous query request.
EndFetchData protected
method EndFetchData(ar: IAsyncResult)
void EndFetchData(IAsyncResult ar)
Sub EndFetchData(ar As IAsyncResult)
Parameters:
- ar:
EndInit (declared in BaseDataAdapter)
method EndInit
void EndInit()
Sub EndInit()
EndInternalUpdate protected (declared in BaseDataAdapter)
Finishes the asynchronous data update operation and performs needed cleanup actions, f.e. merges back updated AutoInc values retrieved from the server.
method EndInternalUpdate(ar: IAsyncResult)
void EndInternalUpdate(IAsyncResult ar)
Sub EndInternalUpdate(ar As IAsyncResult)
Parameters:
- ar: Object representing the status of an asynchronous operation
EnterCriticalSection protected (declared in BaseDataAdapter)
This method is called on entering a method or code region that should be accessed by a single thread only at any given moment of time.
If a thread calls this method while such method is being executed then the calling thread will be paused until the critical code section is released by the blocking thread.
method EnterCriticalSection(status: DataAdapterStatus)
void EnterCriticalSection(DataAdapterStatus status)
Sub EnterCriticalSection(status As DataAdapterStatus)
Parameters:
- status: Value that should be assigned to the BaseDataAdapter property until the critical code section is exited
Execute (String): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String): Int32
Int32 Execute(String commandName)
Function Execute(commandName As String) As Int32
Parameters:
- commandName:
Execute (String, array of Object, DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; inputParameters: array of Object; out outputParameterts: DataParameter): Int32
Int32 Execute(String commandName, Object[] inputParameters, out DataParameter outputParameterts)
Function Execute(commandName As String, inputParameters As Object(), <OutAttribute> ByRef outputParameterts As DataParameter) As Int32
Parameters:
- commandName:
- inputParameters:
- outputParameterts:
Execute (String, array of DataParameter, DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; inputParameters: array of DataParameter; out outputParameterts: DataParameter): Int32
Int32 Execute(String commandName, DataParameter[] inputParameters, out DataParameter outputParameterts)
Function Execute(commandName As String, inputParameters As DataParameter(), <OutAttribute> ByRef outputParameterts As DataParameter) As Int32
Parameters:
- commandName:
- inputParameters:
- outputParameterts:
Execute (String, array of Object): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; params inputParameters: array of Object): Int32
Int32 Execute(String commandName, params Object[] inputParameters)
Function Execute(commandName As String, ParamArray inputParameters As Object()) As Int32
Parameters:
- commandName:
- inputParameters:
Execute (String, array of DataParameter): Int32 (declared in BaseDataAdapter)
method Execute(commandName: String; params inputParameters: array of DataParameter): Int32
Int32 Execute(String commandName, params DataParameter[] inputParameters)
Function Execute(commandName As String, ParamArray inputParameters As DataParameter()) As Int32
Parameters:
- commandName:
- inputParameters:
Execute (array of IQueryable): array of Object
method Execute(query: array of IQueryable): array of Object
Object[] Execute(IQueryable[] query)
Function Execute(query As IQueryable()) As Object()
Parameters:
- query:
ExitCriticalSection protected (declared in BaseDataAdapter)
This method is called on exiting a method or code region that should be accessed by a single thread only at any given moment of time.
This method sets the BaseDataAdapter property to RemoteAdapterStatus.Idle and then releases the critical code section lock.
method ExitCriticalSection
void ExitCriticalSection()
Sub ExitCriticalSection()
FetchData protected
method FetchData(request: array of TableRequestInfo; tableName: array of String; fillMethod: Action<Int32, array of Int32, IDataReader>)
void FetchData(TableRequestInfo[] request, String[] tableName, Action<Int32, array of Int32, IDataReader> fillMethod)
Sub FetchData(request As TableRequestInfo(), tableName As String(), fillMethod As Action (Of Int32, Int32(), IDataReader))
Parameters:
- request:
- tableName:
- fillMethod:
FlushSchema (declared in BaseDataAdapter)
Cleans up the Schema cache and sets the BaseDataAdapter to null.
method FlushSchema
void FlushSchema()
Sub FlushSchema()
GetPendingDeltas protected
method GetPendingDeltas: array of Delta
Delta[] GetPendingDeltas()
Function GetPendingDeltas() As Delta()
GetTable<T>
method GetTable<T>: RemoteTable<T>
RemoteTable<T> GetTable<T>()
Function GetTable<T>() As RemoteTable<T>
GetTable<T> (array of Object): RemoteTableQuery<T>
method GetTable<T>(params parameters: array of Object): RemoteTableQuery<T>
RemoteTableQuery<T> GetTable<T>(params Object[] parameters)
Function GetTable<T>(ParamArray parameters As Object()) As RemoteTableQuery<T>
Parameters:
- parameters:
GetTable<T> (array of DataParameter): RemoteTableQuery<T>
method GetTable<T>(params parameters: array of DataParameter): RemoteTableQuery<T>
RemoteTableQuery<T> GetTable<T>(params DataParameter[] parameters)
Function GetTable<T>(ParamArray parameters As DataParameter()) As RemoteTableQuery<T>
Parameters:
- parameters:
InitScriptProvider
method InitScriptProvider: Boolean
Boolean InitScriptProvider()
Function InitScriptProvider() As Boolean
InsertRow<T>
method InsertRow<T>(data: T): DeltaChange
DeltaChange InsertRow<T>(T data)
Function InsertRow<T>(data As T) As DeltaChange
Parameters:
- data:
LoadScripts (declared in BaseDataAdapter)
Downloads Business Rules Scripting API scripts from the server.
In its current implementation this method downloads entire Schema from the Data Abstract server.
method LoadScripts
void LoadScripts()
Sub LoadScripts()
NewRow<T>
method NewRow<T>: T
T NewRow<T>()
Function NewRow<T>() As T
ProcessPendingChangeDeltas protected
method ProcessPendingChangeDeltas(serverDeltas: array of Delta; originalDeltaChangeIds: IDictionary<String, array of Int32>)
void ProcessPendingChangeDeltas(Delta[] serverDeltas, IDictionary<String, array of Int32> originalDeltaChangeIds)
Sub ProcessPendingChangeDeltas(serverDeltas As Delta(), originalDeltaChangeIds As IDictionary<String, array of Int32>)
Parameters:
- serverDeltas:
- originalDeltaChangeIds:
ReadSchema (declared in BaseDataAdapter)
Downloads the Schema from the Data Abstract server .
method ReadSchema(forceRefresh: Boolean): Schema
Schema ReadSchema(Boolean forceRefresh)
Function ReadSchema(forceRefresh As Boolean) As Schema
Parameters:
- forceRefresh: Flag indicating whether Schema should be downloaded even if the Schema is already cached in the Schema property
ReadStreamerSchema protected (declared in BaseDataAdapter)
Downloads the Schema from the Data Abstract server. This method is used when the server exposes the Schema using method that sends it using highly-optimized binary stream (opposing to the BaseDataAdapter method that is called when the server exposes its Schema as Xml).
method ReadStreamerSchema: Binary
Binary ReadStreamerSchema()
Function ReadStreamerSchema() As Binary
RemoveAsyncResult
method RemoveAsyncResult(query: IQueryable)
void RemoveAsyncResult(IQueryable query)
Sub RemoveAsyncResult(query As IQueryable)
Parameters:
- query:
ThrowFailures protected
This method is called at the end of the ApplyChanges method. It throws a DAUpdatesFailedException if the provided aChanges list is not empty (which means that some DeltaChanges were not processed successfully) and the FailureBehavior property is set to FailureBehavior.RaiseException or FailureBehavior.Both.
method ThrowFailures(changes: List<DeltaChange>; failureMessage: String)
void ThrowFailures(List<DeltaChange> changes, String failureMessage)
Sub ThrowFailures(changes As List<DeltaChange>, failureMessage As String)
Parameters:
- changes:
- failureMessage:
TriggerApplyChanges protected
method TriggerApplyChanges
void TriggerApplyChanges()
Sub TriggerApplyChanges()
UpdateRow<T> (T): DeltaChange
method UpdateRow<T>(data: T): DeltaChange
DeltaChange UpdateRow<T>(T data)
Function UpdateRow<T>(data As T) As DeltaChange
Parameters:
- data:
UpdateRow<T> (T, T): DeltaChange
method UpdateRow<T>(originalData: T; newData: T): DeltaChange
DeltaChange UpdateRow<T>(T originalData, T newData)
Function UpdateRow<T>(originalData As T, newData As T) As DeltaChange
Parameters:
- originalData:
- newData:
OnApplyChanges
This event is fired before any data changes are sent to the DataAbstract server. It can be used to perform data validation, changes logging, etc.
event OnApplyChanges: EventHandler;
delegate EventHandler OnApplyChanges()
Event OnApplyChanges As EventHandler