RemoteTable<T>
Overview
The RemoteTable<T> class represents the data table on the remote DataAbstract server. The T-type defines which Schema tables to represent. Since it implements the System.Linq.IQueryProvider interface, it can be used as LINQ Provider for DA data sources.
Service class for LINQ
To create a LINQ request for a DA server, you should have a set of classes that represent tables in the schema. These classes are used as generic types in RemoteTable<T> instances.
Normally, you will not need to create classes for your Schema manually. Instead, you can use the "Create DA Linq Classes" option of the LinqDataAdapter control to generate it. For more information about this option, see the DA LINQ article.
Location
- Reference: RemObjects.DataAbstract.dll
- Namespace: RemObjects.DataAbstract.Linq
- Platforms: .NET Core, .NET Framework, .NET Standard
- Ancestry: RemoteTableQuery<T> | RemoteTable<T>
constructor (declared in RemoteTableQuery<T>)
Default constructor that creates an instance of the RemoteTableQuery.
constructor
RemoteTable<T>()
init()
Sub New()
constructor (IRemoteQueryProvider, Expression) (declared in RemoteTableQuery<T>)
Creates a new instance of the RemoteTableQuery and associates it with a LINQ Expression and provider.
constructor(aProvider: IRemoteQueryProvider; aExpression: Expression)
RemoteTable<T>(IRemoteQueryProvider aProvider, Expression aExpression)
init(_ aProvider: IRemoteQueryProvider, _ aExpression: Expression)
Sub New(aProvider As IRemoteQueryProvider, aExpression As Expression)
Parameters:
- aProvider: Implementor of IRemoteQueryProvider that is able to execute
aExpression
. - aExpression: LINQ Expression appropriate to current instance.
constructor (LinqDataAdapter)
Creates a new instance of the RemoteTable class and processes the following:
- Stores the reference for the parent dataAdapter
- Sets the TableName property
- Fills the Schema property according to the attributes of the type T.
constructor(dataAdapter: LinqDataAdapter)
RemoteTable<T>(LinqDataAdapter dataAdapter)
init(_ dataAdapter: LinqDataAdapter)
Sub New(dataAdapter As LinqDataAdapter)
Parameters:
- dataAdapter: Data Adapter instance that will provide data and process changes of this RemoteTable instance
CancelChanges
method CancelChanges
void CancelChanges()
func CancelChanges()
Sub CancelChanges()
Changes
Gets a collection of DeltaChange items.
This collection maintains a list of inserted, deleted and updated rows in the DataTable. It is used internally by Data Adapter to send the modified data back to the server.
property Changes: Delta read;
Delta Changes { get; }
var Changes: Delta { get{} }
ReadOnly Property Changes() As Delta
CloneTable
method CloneTable(data: T): T
T CloneTable(T data)
func CloneTable(_ data: T) -> T
Function CloneTable(data As T) As T
Parameters:
- data:
CreateQuery
method CreateQuery(expression: Expression): IQueryable
IQueryable CreateQuery(Expression expression)
func CreateQuery(_ expression: Expression) -> IQueryable
Function CreateQuery(expression As Expression) As IQueryable
Parameters:
- expression:
CreateQuery<S>
method CreateQuery<S>(expression: Expression): IQueryable<S>
IQueryable<S> CreateQuery<S>(Expression expression)
func CreateQuery<S>(_ expression: Expression) -> IQueryable<S>
Function CreateQuery<S>(expression As Expression) As IQueryable<S>
Parameters:
- expression:
DataAdapter
property DataAdapter: LinqDataAdapter read;
LinqDataAdapter DataAdapter { get; }
var DataAdapter: LinqDataAdapter { get{} }
ReadOnly Property DataAdapter() As LinqDataAdapter
DeleteRow
Deletes the row that represents the provided object from the corresponding RemoteTable instance. This change will be applied to the remote database once the parent LinqDataAdapter.ApplyChanges method is called. This method returns the DeltaChange class, which represents the data table changes explained above. This object can be used if you need to set some of its properties manually.
method DeleteRow(data: T): DeltaChange
DeltaChange DeleteRow(T data)
func DeleteRow(_ data: T) -> DeltaChange
Function DeleteRow(data As T) As DeltaChange
Parameters:
- data: Object whose representation should be deleted from the database.
DeriveSchema protected
Instantiates a 'Schema' property with new SchemaDataTable. This schema will be based on the T-type of current RemoteTable instance. Schema data is filled from field Attributes of T-class (such as FieldNameAttribute, DataTypeAttribute, etc).
Note, that result Schema will contain only "valid" properties (properties with get, set access, properties without IgnorePropertyAttribute)
Also, this method instantiates a Changes collection using created schema.
method DeriveSchema
void DeriveSchema()
func DeriveSchema()
Sub DeriveSchema()
ElementType (declared in RemoteTableQuery<T>)
Returns a generic type for the current class instance.
For example, if the RemoteTableQuery<T> is instantiated like the RemoteTableQuery<Worker
>, this property will return the type of the Worker class.
property ElementType: Type read;
Type ElementType { get; }
var ElementType: Type { get{} }
ReadOnly Property ElementType() As Type
Execute (Expression): Object
method Execute(expression: Expression): Object
Object Execute(Expression expression)
func Execute(_ expression: Expression) -> Object
Function Execute(expression As Expression) As Object
Parameters:
- expression:
Execute (Expression, array of DataParameter): Object
method Execute(expression: Expression; parameters: array of DataParameter): Object
Object Execute(Expression expression, DataParameter[] parameters)
func Execute(_ expression: Expression, _ parameters: DataParameter...) -> Object
Function Execute(expression As Expression, parameters As DataParameter()) As Object
Parameters:
- expression:
- parameters:
Expression (declared in RemoteTableQuery<T>)
Returns the LINQ expression tree of the current instance.
property Expression: Expression read write;
Expression Expression { get; set; }
var Expression: Expression { get{} set{} }
Property Expression() As Expression
GenExecute<S>
method GenExecute<S>(expression: Expression): S
S GenExecute<S>(Expression expression)
func GenExecute<S>(_ expression: Expression) -> S
Function GenExecute<S>(expression As Expression) As S
Parameters:
- expression:
GetEnumerable (declared in RemoteTableQuery<T>)
Returns the result of a query execution as enumarable collection.
Implementation of the IRemoteTableQuery.
method GetEnumerable: IEnumerable
IEnumerable GetEnumerable()
func GetEnumerable() -> IEnumerable
Function GetEnumerable() As IEnumerable
GetEnumerator (declared in RemoteTableQuery<T>)
Returns an enumerator of generic type through the result of the query execution.
Implementation of the System.Collections.IEnumerable.
method GetEnumerator: IEnumerator<T>
IEnumerator<T> GetEnumerator()
func GetEnumerator() -> IEnumerator<T>
Function GetEnumerator() As IEnumerator<T>
GetEnumerator2 (declared in RemoteTableQuery<T>)
Similar to GetEnumerator()
, with the difference that a result of this method is not connected with a generic type.
method GetEnumerator2: IEnumerator
IEnumerator GetEnumerator2()
func GetEnumerator2() -> IEnumerator
Function GetEnumerator2() As IEnumerator
GetPropertiesWithRelation
Returns list of properties of class T that marked with RelationAttribute
Implementation of IRemoteTable.
method GetPropertiesWithRelation: array of PropertyInfo
PropertyInfo[] GetPropertiesWithRelation()
func GetPropertiesWithRelation() -> PropertyInfo...
Function GetPropertiesWithRelation() As PropertyInfo()
GetQueryText
method GetQueryText(expression: Expression): String
String GetQueryText(Expression expression)
func GetQueryText(_ expression: Expression) -> String
Function GetQueryText(expression As Expression) As String
Parameters:
- expression:
InsertRow
Inserts the row that represents the provided object to the corresponding RemoteTable instance. This change will be applied to the remote database once the LinqDataAdapter.ApplyChanges method is called. This method returns the DeltaChange class, which represents the data table changes explained above. This object can be used if you need to set some of its properties manually.
method InsertRow(data: T): DeltaChange
DeltaChange InsertRow(T data)
func InsertRow(_ data: T) -> DeltaChange
Function InsertRow(data As T) As DeltaChange
Parameters:
- data: Object whose representation should be inserted into the database.
MergeChanges
Merges delta changes of current table representation with its original data.
Usually called after changes have been applied successfully on server-side.
Implementation of IRemoteTable
method MergeChanges
void MergeChanges()
func MergeChanges()
Sub MergeChanges()
Provider (declared in RemoteTableQuery<T>)
property Provider: IQueryProvider read;
IQueryProvider Provider { get; }
var Provider: IQueryProvider { get{} }
ReadOnly Property Provider() As IQueryProvider
RemoveChange
method RemoveChange(change: DeltaChange)
void RemoveChange(DeltaChange change)
func RemoveChange(_ change: DeltaChange)
Sub RemoveChange(change As DeltaChange)
Parameters:
- change:
Schema
Represents the part of the Schema for the T-related table. It fills when creating an instance by using the Attributes of the T-class properties.
(Implementation of IRemoteTable
)
property Schema: SchemaDataTable read;
SchemaDataTable Schema { get; }
var Schema: SchemaDataTable { get{} }
ReadOnly Property Schema() As SchemaDataTable
TableName protected
Table name retrieved from the TableNameAttribute of T type
(Implementation of the IRemoteTable
)
property TableName: String read;
String TableName { get; }
var TableName: String { get{} }
ReadOnly Property TableName() As String
ToString
Returns string representation of T type
method ToString: String
String ToString()
func ToString() -> String
Function ToString() As String
UpdateRow (T): DeltaChange
method UpdateRow(data: T): DeltaChange
DeltaChange UpdateRow(T data)
func UpdateRow(_ data: T) -> DeltaChange
Function UpdateRow(data As T) As DeltaChange
Parameters:
- data:
UpdateRow (T, T): DeltaChange
method UpdateRow(originalData: T; newData: T): DeltaChange
DeltaChange UpdateRow(T originalData, T newData)
func UpdateRow(_ originalData: T, _ newData: T) -> DeltaChange
Function UpdateRow(originalData As T, newData As T) As DeltaChange
Parameters:
- originalData:
- newData:
Changes
Gets a collection of DeltaChange items.
This collection maintains a list of inserted, deleted and updated rows in the DataTable. It is used internally by Data Adapter to send the modified data back to the server.
property Changes: Delta read;
Delta Changes { get; }
var Changes: Delta { get{} }
ReadOnly Property Changes() As Delta
DataAdapter
property DataAdapter: LinqDataAdapter read;
LinqDataAdapter DataAdapter { get; }
var DataAdapter: LinqDataAdapter { get{} }
ReadOnly Property DataAdapter() As LinqDataAdapter
ElementType (declared in RemoteTableQuery<T>)
Returns a generic type for the current class instance.
For example, if the RemoteTableQuery<T> is instantiated like the RemoteTableQuery<Worker
>, this property will return the type of the Worker class.
property ElementType: Type read;
Type ElementType { get; }
var ElementType: Type { get{} }
ReadOnly Property ElementType() As Type
Expression (declared in RemoteTableQuery<T>)
Returns the LINQ expression tree of the current instance.
property Expression: Expression read write;
Expression Expression { get; set; }
var Expression: Expression { get{} set{} }
Property Expression() As Expression
Provider (declared in RemoteTableQuery<T>)
property Provider: IQueryProvider read;
IQueryProvider Provider { get; }
var Provider: IQueryProvider { get{} }
ReadOnly Property Provider() As IQueryProvider
Schema
Represents the part of the Schema for the T-related table. It fills when creating an instance by using the Attributes of the T-class properties.
(Implementation of IRemoteTable
)
property Schema: SchemaDataTable read;
SchemaDataTable Schema { get; }
var Schema: SchemaDataTable { get{} }
ReadOnly Property Schema() As SchemaDataTable
TableName protected
Table name retrieved from the TableNameAttribute of T type
(Implementation of the IRemoteTable
)
property TableName: String read;
String TableName { get; }
var TableName: String { get{} }
ReadOnly Property TableName() As String
constructor (declared in RemoteTableQuery<T>)
Default constructor that creates an instance of the RemoteTableQuery.
constructor
RemoteTable<T>()
init()
Sub New()
constructor (IRemoteQueryProvider, Expression) (declared in RemoteTableQuery<T>)
Creates a new instance of the RemoteTableQuery and associates it with a LINQ Expression and provider.
constructor(aProvider: IRemoteQueryProvider; aExpression: Expression)
RemoteTable<T>(IRemoteQueryProvider aProvider, Expression aExpression)
init(_ aProvider: IRemoteQueryProvider, _ aExpression: Expression)
Sub New(aProvider As IRemoteQueryProvider, aExpression As Expression)
Parameters:
- aProvider: Implementor of IRemoteQueryProvider that is able to execute
aExpression
. - aExpression: LINQ Expression appropriate to current instance.
constructor (LinqDataAdapter)
Creates a new instance of the RemoteTable class and processes the following:
- Stores the reference for the parent dataAdapter
- Sets the TableName property
- Fills the Schema property according to the attributes of the type T.
constructor(dataAdapter: LinqDataAdapter)
RemoteTable<T>(LinqDataAdapter dataAdapter)
init(_ dataAdapter: LinqDataAdapter)
Sub New(dataAdapter As LinqDataAdapter)
Parameters:
- dataAdapter: Data Adapter instance that will provide data and process changes of this RemoteTable instance
CancelChanges
method CancelChanges
void CancelChanges()
func CancelChanges()
Sub CancelChanges()
CloneTable
method CloneTable(data: T): T
T CloneTable(T data)
func CloneTable(_ data: T) -> T
Function CloneTable(data As T) As T
Parameters:
- data:
CreateQuery
method CreateQuery(expression: Expression): IQueryable
IQueryable CreateQuery(Expression expression)
func CreateQuery(_ expression: Expression) -> IQueryable
Function CreateQuery(expression As Expression) As IQueryable
Parameters:
- expression:
CreateQuery<S>
method CreateQuery<S>(expression: Expression): IQueryable<S>
IQueryable<S> CreateQuery<S>(Expression expression)
func CreateQuery<S>(_ expression: Expression) -> IQueryable<S>
Function CreateQuery<S>(expression As Expression) As IQueryable<S>
Parameters:
- expression:
DeleteRow
Deletes the row that represents the provided object from the corresponding RemoteTable instance. This change will be applied to the remote database once the parent LinqDataAdapter.ApplyChanges method is called. This method returns the DeltaChange class, which represents the data table changes explained above. This object can be used if you need to set some of its properties manually.
method DeleteRow(data: T): DeltaChange
DeltaChange DeleteRow(T data)
func DeleteRow(_ data: T) -> DeltaChange
Function DeleteRow(data As T) As DeltaChange
Parameters:
- data: Object whose representation should be deleted from the database.
DeriveSchema protected
Instantiates a 'Schema' property with new SchemaDataTable. This schema will be based on the T-type of current RemoteTable instance. Schema data is filled from field Attributes of T-class (such as FieldNameAttribute, DataTypeAttribute, etc).
Note, that result Schema will contain only "valid" properties (properties with get, set access, properties without IgnorePropertyAttribute)
Also, this method instantiates a Changes collection using created schema.
method DeriveSchema
void DeriveSchema()
func DeriveSchema()
Sub DeriveSchema()
Execute (Expression): Object
method Execute(expression: Expression): Object
Object Execute(Expression expression)
func Execute(_ expression: Expression) -> Object
Function Execute(expression As Expression) As Object
Parameters:
- expression:
Execute (Expression, array of DataParameter): Object
method Execute(expression: Expression; parameters: array of DataParameter): Object
Object Execute(Expression expression, DataParameter[] parameters)
func Execute(_ expression: Expression, _ parameters: DataParameter...) -> Object
Function Execute(expression As Expression, parameters As DataParameter()) As Object
Parameters:
- expression:
- parameters:
GenExecute<S>
method GenExecute<S>(expression: Expression): S
S GenExecute<S>(Expression expression)
func GenExecute<S>(_ expression: Expression) -> S
Function GenExecute<S>(expression As Expression) As S
Parameters:
- expression:
GetEnumerable (declared in RemoteTableQuery<T>)
Returns the result of a query execution as enumarable collection.
Implementation of the IRemoteTableQuery.
method GetEnumerable: IEnumerable
IEnumerable GetEnumerable()
func GetEnumerable() -> IEnumerable
Function GetEnumerable() As IEnumerable
GetEnumerator (declared in RemoteTableQuery<T>)
Returns an enumerator of generic type through the result of the query execution.
Implementation of the System.Collections.IEnumerable.
method GetEnumerator: IEnumerator<T>
IEnumerator<T> GetEnumerator()
func GetEnumerator() -> IEnumerator<T>
Function GetEnumerator() As IEnumerator<T>
GetEnumerator2 (declared in RemoteTableQuery<T>)
Similar to GetEnumerator()
, with the difference that a result of this method is not connected with a generic type.
method GetEnumerator2: IEnumerator
IEnumerator GetEnumerator2()
func GetEnumerator2() -> IEnumerator
Function GetEnumerator2() As IEnumerator
GetPropertiesWithRelation
Returns list of properties of class T that marked with RelationAttribute
Implementation of IRemoteTable.
method GetPropertiesWithRelation: array of PropertyInfo
PropertyInfo[] GetPropertiesWithRelation()
func GetPropertiesWithRelation() -> PropertyInfo...
Function GetPropertiesWithRelation() As PropertyInfo()
GetQueryText
method GetQueryText(expression: Expression): String
String GetQueryText(Expression expression)
func GetQueryText(_ expression: Expression) -> String
Function GetQueryText(expression As Expression) As String
Parameters:
- expression:
InsertRow
Inserts the row that represents the provided object to the corresponding RemoteTable instance. This change will be applied to the remote database once the LinqDataAdapter.ApplyChanges method is called. This method returns the DeltaChange class, which represents the data table changes explained above. This object can be used if you need to set some of its properties manually.
method InsertRow(data: T): DeltaChange
DeltaChange InsertRow(T data)
func InsertRow(_ data: T) -> DeltaChange
Function InsertRow(data As T) As DeltaChange
Parameters:
- data: Object whose representation should be inserted into the database.
MergeChanges
Merges delta changes of current table representation with its original data.
Usually called after changes have been applied successfully on server-side.
Implementation of IRemoteTable
method MergeChanges
void MergeChanges()
func MergeChanges()
Sub MergeChanges()
RemoveChange
method RemoveChange(change: DeltaChange)
void RemoveChange(DeltaChange change)
func RemoveChange(_ change: DeltaChange)
Sub RemoveChange(change As DeltaChange)
Parameters:
- change:
ToString
Returns string representation of T type
method ToString: String
String ToString()
func ToString() -> String
Function ToString() As String
UpdateRow (T): DeltaChange
method UpdateRow(data: T): DeltaChange
DeltaChange UpdateRow(T data)
func UpdateRow(_ data: T) -> DeltaChange
Function UpdateRow(data As T) As DeltaChange
Parameters:
- data:
UpdateRow (T, T): DeltaChange
method UpdateRow(originalData: T; newData: T): DeltaChange
DeltaChange UpdateRow(T originalData, T newData)
func UpdateRow(_ originalData: T, _ newData: T) -> DeltaChange
Function UpdateRow(originalData As T, newData As T) As DeltaChange
Parameters:
- originalData:
- newData: