IRemoteQueryProvider
Overview
The IRemoteQueryProvider interface exposes several methods used by DA LINQ for getting appropriate DA SQL strings and executing DA LINQ expressions.
This interface supported by the RemoteTable<T> class. In most of cases there is no need to use this class directly, but it is possible to use it manually, as shown in the following example:
var linq = from prod in DataAdapter.GetTable<Products>()
where prod.Name.Contains("HDD")
select prod;
IRemoteQueryProvider provider = new RemoteTable<Products>(DataAdapter);
String sql = provider.GetQueryText(linq.Expression);
Console.WriteLine("sql: {0} ", sql);
IEnumerable products = (IEnumerable)provider.Execute(linq.Expression);
foreach (Products p in products) {
Console.WriteLine("{0}\t{1}", p.Id, p.Name);
}
Output: sql: SELECT [t0].[GroupId], [t0].[Id], [t0].[Name], [t0].[Obsolete], [t0].[PCode], [t0].[Remarks], [t0].[VendorId], [t0].[Warranty] FROM [Products] AS [t0] WHERE ([t0].[Name] LIKE '%' + :p0 + '%')
d24ecb7d-9efe-412e-a2df-01146a5b5fde Portable HDD 500.0GB Seagate FreeAgent Desktop ST3... 22a8cd1c-b104-4b50-b332-04359b791b5d Portable HDD 120.0GB Seagate Momentus ST901203FGD1... a215bbb3-2a3c-45c5-b602-0546272454f8 HDD box external 3,5" SATA HDD Welland Xpress ME-7... 228742b2-4471-4ee8-b542-2373859fd356 HDD box external 3,5_ IDE SATA HDD Akasa AK-ENP2SA... 62f61647-ec05-4e91-b2b9-253d8e942310 Portable HDD 250.0GB Western Digital My Passport E... ...
Location
- Reference: RemObjects.DataAbstract.dll
- Namespace: RemObjects.DataAbstract.Linq
- Ancestry: IQueryProvider | IRemoteQueryProvider
Properties
DataAdapter
property DataAdapter: LinqDataAdapter read;
LinqDataAdapter DataAdapter { get; }
ReadOnly Property DataAdapter() As LinqDataAdapter
ElementType
property ElementType: Type read;
Type ElementType { get; }
ReadOnly Property ElementType() As Type
Required Methods
Execute
Describes the method that will execute the given DA LINQ expression and return the result data.
method Execute(sql: String; paramNames: array of String; paramValues: array of Object; reader: Func<QueryResult, Object>): Object
Object Execute(String sql, String[] paramNames, Object[] paramValues, Func<QueryResult, Object> reader)
Function Execute(sql As String, paramNames As String(), paramValues As Object(), reader As Func (Of QueryResult, Object)) As Object
Parameters:
- sql:
- paramNames:
- paramValues:
- reader:
GetQueryText
Describes the method that returns the DA SQL query (as string) generated from the given DA LINQ expression.
method GetQueryText(expression: Expression): String
String GetQueryText(Expression expression)
Function GetQueryText(expression As Expression) As String
Parameters:
- expression: