entity-sql

Comparing dates in Entity SQL

What is the correct eSQL syntax to compare dates? The equivalent LINQ-to-Entities expression would look something like this: var lastYearsShipments = from p in MyDataServiceContext.Products where p.ShipDate.Value.Year == DateTime.Now.Year - 1 select p; ...

Comparing Date / DateTime ine Entity SQL Where clause...

I have a method which accepts an ObjectQuery and adds Where clauses to it depending on whether it receives values for various filter parameters. The method has to return an ObjectQuery. How can i do a basic Date comparison e.g. where dateX < dateY. This is my current code: if (myDateFilter != null) { query = query.Where( st...

How to map EntitySql function to a differently named function in the store?

The question is: Given a database backend that understands LeftStr and RightStr: where, in a custom ADO.NET provider implementation, would I establish a mapping to the immutable EDM canonical functions Left and Right? So I am working with the SQLite ADO.NET provider and it works, more or less, until you bump up against some string fun...

Which kinds of queries is better for querying against conceptual model in Entity Framework?

There are 3 way for querying against conceptual model in EF : LINQ to Entity Entity SQL Query Builder Methods Which one is better for which situation? Is there any performance issues for these 3 type of querying? ...

How to implement EntityDataSource Where IN entity sql clause

I want to pass a number of values into a parameter of the EntityDataSource, e.g.: Where="it.ORDER_ID IN {@OrderIdList}" (this is a property on the EntityDataSource) <WhereParameters> <asp:ControlParameter Name="OrderIdList" Type="Int16" ControlID="OrderFilterControl" PropertyName="OrderIdList" /> </WhereParamet...

Entity SQL Using Imported Function

Hi I am trying to use a stored procedure as an imported function in an entity sql statement See my statement below, but this does not seem to work and I'm having a hard time finding out how imported functions are used in Entity SQL SELECT Cp.Calendar_Reference FROM Model.Calendar("CY", DATETIME'1999-01-01 00:0:00', DATETIME'2009-01-0...

Entity SQL query with hierarchal relation

I want to use Entity SQL to query the elements of some subtype in my Entity Model. For instance... SELECT VALUE c FROM Persons AS c WHERE c is of (Customer) no problem meanwhile, but if I try the following query where Active is a property of Customer entity... SELECT VALUE c FROM Persons AS c WHERE c is of (Customer) AND c.Active == ...

Compiled Entity SQL query and OrderBy

I'm trying to come up with an compiled query using Entity SQL and I'm getting this error on ToList() line: LINQ to Entities does not recognize the method 'System.Data.Objects.ObjectQuery`1[BLL.Company] OrderBy(System.String, System.Data.Objects.ObjectParameter[])' method, and this method cannot be translated into a store expression. He...

Dynamically sorting and filtering projected Entity SQL results

I have the following query which I want to sort or filter using projected class names: List<CompanyInfo> list = new List<CompanyInfo>(); using (var db = new DbContext()) { list.AddRange( db.Companies.Include("Projects") .Select(row => new CompanyInfo() { Pr...