IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace : PassthruEsqlQuery Class |
'Declaration
Public Class PassthruEsqlQuery Implements IEntityQuery, IUntypedEntityQuery, System.ICloneable
'Usage
Dim instance As PassthruEsqlQuery
public class PassthruEsqlQuery : IEntityQuery, IUntypedEntityQuery, System.ICloneable
A PassthruEsqlQuery must always use a FetchStrategy of DataSourceOnly, and cannot be used when disconnected from the EntityServer.
// Sample 1 - A sample PassthruEsqlQuery returning a SalesPerson entity. private void Sample1() { AW2000Model.Manager mgr = new AW2000Model.Manager(); // Create a parameter and the parameterized sql QueryParameter param = new QueryParameter("bonus", 2000); ParameterizedEsql paramEsql = new ParameterizedEsql("SELECT VALUE sp FROM SalesPersons AS sp Where sp.Bonus > @bonus", param); // Create and execute the query var query = new PassthruEsqlQuery(typeof(SalesPerson), paramEsql); var results = mgr.ExecuteQuery(query); } // Sample 2 - a sample PassthruEsqlQuery returning a scalar value. private void Sample2() { AW2000Model.Manager mgr = new AW2000Model.Manager(); // Create the query - note you must provide both the returnType and queryableType arguments here. var query = new PassthruEsqlQuery(typeof(Int32), typeof(Customer), "SELECT VALUE Count(c.CustomerType) FROM Customers AS c Where c.CustomerID < 10"); int result = mgr.ExecuteQuery(query).Cast<Int32>().First(); }
System.Object
IdeaBlade.EntityModel.PassthruEsqlQuery
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2