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
18
votes
6 answers

Performance of Linq to Entities vs ESQL

When using the Entity Framework, does ESQL perform better than Linq to Entities? I'd prefer to use Linq to Entities (mainly because of the strong-type checking), but some of my other team members are citing performance as a reason to use ESQL. I…
Brad Leach
  • 16,857
  • 17
  • 72
  • 88
14
votes
3 answers

In what situations should I use Entity SQL?

I was wondering whether there are situation that's more advisable to use ESQL? Generally, I find ESQL frustrating (specially with all the special cases where you need to fully qualify an entity type) & probably anything done using ESQL can be done…
Shady M. Najib
  • 2,151
  • 2
  • 19
  • 30
13
votes
3 answers

Entity Framework & LINQ To SQL - Conflict of interest?

I've been reading on the blogosphere for the past week that Linq to SQL is dead [and long live EF and Linq to Entities]. But when I read the overview on MSDN, it appeared to me Linq to Entities generates eSQL just the way Linq to SQL generates SQL…
9
votes
1 answer

Can I use a CAST inside a LINQ to Entities query?

I have a LINQ to Entities query From item In ctx.Items Select new { ListPrice = item.Cost / (1M - item.Markup) }; Can I specify to EF that I want it to apply a cast to the list price before querying and materializing it1? Is there something…
just.another.programmer
  • 8,579
  • 8
  • 51
  • 90
7
votes
2 answers

Use "option(maxrecursion 0)" with EntityFramework EntitySql

I have a SqlServer function that performs a recrusive select with cte based on an input, which is a csv string with ids. Unfortunately I can't use "option(maxrecursion 0)" inside my function, it must be used when the function is executed. The…
6
votes
3 answers

Viewing Entity SQL produced by Linq-to-Entities

Is there a way I can view the Entity Sql (eSQL) that my Linq-to-entities queries are generating with EF framework (that is, not native SQL, but eSQL, if that makes sense?) Thanks!
Sean
  • 203
  • 4
  • 14
6
votes
2 answers

Entity Framework 4.0 Entity SQL passing null ObjectParameter parameters

I have an Entity SQL query: SELECT VALUE t FROM MyEntities AS t WHERE t.Name = @p OR (@p IS NULL AND t.Name IS NULL) I can execute the query as follows: var results = context.CreateQuery( query, new ObjectParameter("p",…
Mas
  • 4,546
  • 5
  • 39
  • 56
5
votes
1 answer

Can someone explain what REF, CREATEREF, DEREF, KEY in Entity SQL do?

I can't find good documentation on these operators. Can someone provide some examples of use and explain what they do?
Piotr Perak
  • 10,718
  • 9
  • 49
  • 86
4
votes
1 answer

Converting ESQL to LINQ to Entities. Sort by related entities

I am using EF + RIA and unfortunately meet some problems with sorting by related entities. For such purpose there is ESQL query that I implemented (found only this solution): var queryESQL = string.Format( @" select VALUE ent from SomeEntities as…
4
votes
1 answer

Entity Framework 4.0: Entity SQL CAST Operation Not Working

I'm trying to make a query where I cast a text column, which contains an integer as text, to an Int32. Here's the query: SELECT VALUE t FROM MyEntities AS t WHERE CAST(t.TextColumn AS Edm.Int32) > 5 However, I get an System.Data.EntitySqlException…
Mas
  • 4,546
  • 5
  • 39
  • 56
4
votes
2 answers

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)
TonyS
  • 556
  • 8
  • 11
4
votes
1 answer

Differences between System.Linq.Dynamic, EntitySQL and Expression Trees

I am currently working on a large project that uses Entity Framework extensively. Part of the functionality we have implemented is dynamic querying (Filter/Sort) of the various data models based on user-supplied filters. To achieve this I ended up…
3
votes
2 answers

like operator in entitydatasource

I'm using an EntityDataSource in an asp .net form and a Gridview is bound to it. A where clause is used in the entityDataSource: Where="it.Name like '%@Name%' @Name is a parameter:
user1223444
3
votes
1 answer

Comparing DateTime values in EntitySQL when starting with a querystring

I am using the QueryBuilder as following: var queryString = String.Format( "SELECT VALUE e FROM Entity AS e WHERE e.EndDate {0} {1} ", operator, DateTime.Today.AddYears(1).ToString("d",…
sra
  • 23,820
  • 7
  • 55
  • 89
3
votes
3 answers

EntitySQL and SQL injection

I've got the following query string "SELECT VALUE entity FROM Entities AS entity WHERE entity.Client_id = 0 && entity.Name LIKE @searchvalue ORDER BY @sorting SKIP @skip LIMIT @limit" with the following param replacement query.Parameters.Add(new…
sra
  • 23,820
  • 7
  • 55
  • 89
1
2 3 4 5 6 7