Questions tagged [entity-sql]

Entity SQL is a storage-independent query language that is similar to SQL.

Entity SQL is a storage-independent query language that is similar to SQL. Entity SQL allows you to query entity data, either as objects or in a tabular form.

98 questions
3
votes
1 answer

ESQL in Entity Framework

Is there any good and, if possible, exhaustive documentation about ESQL in entity framework ? I'm trying to make a select of an entity object with modification of a property using a method; something like this : SELECT foo FROM context.foo WHERE…
eka808
  • 2,257
  • 3
  • 29
  • 41
3
votes
1 answer

Search using Regex in Entity Framework

I want to search for a string pattern in a database table. The search pattern is simply the string entered by the user. However the field to be searched can have spaces in between, or user might enter spaces in the string. So I want to create a…
gunnerz
  • 1,898
  • 5
  • 24
  • 39
3
votes
1 answer

Linq-To-Entities 'Contains' clause 1-many relationship

Consider a (simplified) table structure like this: [USERS] EMPID NAME [APPOINTMENTS] (FK_APPT_USER) EMPID APPTTYPEID COMPLETE Each user can have 0..* appointments, each of which can be one of many APPTYPEID's, and can either be complete or…
NMR
  • 166
  • 8
3
votes
0 answers

How to ORDER BY non-column field?

I am trying to create an Entity SQL that is a union of two sub-queries. (SELECT VALUE DISTINCT ROW(e.ColumnA, e.ColumnB, 1 AS Rank) FROM Context.Entity AS E WHERE ...) UNION ALL (SELECT VALUE DISTINCT ROW(e.ColumnA, e.ColumnB, 2 AS Rank) FROM…
Phil Bolduc
  • 1,586
  • 1
  • 11
  • 19
2
votes
2 answers

In what scenarios would I need to use the CREATEREF, DEREF and REF keywords?

This question is about why I would use the above keywords. I've found plenty of MSDN pages that explain how. I'm looking for the why. What query would I be trying to write that means I need them? I ask because the examples I have found appear to…
J M
  • 1,877
  • 2
  • 20
  • 32
2
votes
1 answer

Entity SQL IN/Multiset issue

I am using the following query in entity sql Select n.Name as NodeNameN from Nodes as n where n.Name IN MultiSet (@Test) The value is substitued at runtime using the below code : var reader =…
Ram sundar
  • 23
  • 2
2
votes
2 answers

Entity Sql for a Many to Many relationship

Consider two tables Bill and Product with a many to many relationship. How do you get all the bills for a particular product using Entity Sql?
2
votes
1 answer

Fetch only key value from EF association

I've set up a many-to-many association between two tables based on a third table that just holds a pair of key values. Now I'd like to do a query that groups the right tables key values by the lefts without needing other data. LeftTable { LeftID,…
eddwo
  • 301
  • 3
  • 8
2
votes
4 answers

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 list = new List(); using (var db = new DbContext()) { list.AddRange( db.Companies.Include("Projects") …
dstr
  • 8,362
  • 12
  • 66
  • 106
2
votes
3 answers

How to write Dynamic LINQ queries using DBContext in C#

I am modifying my project to use DBContext instead of ObjectContext. My existing code var query = context.Vehicles.OrderBy("it.VehicleType.VehicleTypeID"). GroupBy("it.VehicleType.VehicleTypeID", "Min(it.ODO_Reading) AS MinRunVehicle,…
LalithaT
  • 73
  • 6
2
votes
1 answer

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?
masoud ramezani
  • 22,228
  • 29
  • 98
  • 151
2
votes
1 answer

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…
Sky Sanders
  • 36,396
  • 8
  • 69
  • 90
2
votes
1 answer

entity sql count null

I'm having trouble with counting null values using Entity SQL. Code in SQL: SELECT Table.City, COUNT(*) FROM Table GROUP BY Table.City and in Linq to Entities: var query1 = from g in context.Table group g by g.City into mygroup …
Dayton Tex
  • 844
  • 3
  • 10
  • 18
2
votes
1 answer

Concat Two DataTime Field in EntityDataSource

I have two fields with Edm.DateTime type. How can I get just Time in h:mm format and concat them in CommandText of EntityDataSource: "01/02/2013 3:15 AM and 01/02/2013 4:15 AM" should be "15:15-16:15" I found cast for concat, Is it right…
2
votes
1 answer

ESQL does not work

I am working on a WCF, Entity Framework, Self track solution. I have a problem with the ESQL. string cmd = "Select h.achAccId, p.patDOBirth, p.patGender from PatientEntities.AccBases as a, PatientEntities.AccHosps as h, PatientEntities.Patients as p…
peter
  • 1,009
  • 3
  • 15
  • 23