entity-sql

Converting ESQL to LINQ to Entities. Sort by related entities

非 Y 不嫁゛ 提交于 2019-12-05 14:29:10
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 ent join Attributes as ea ON ea.EntityId = ent.Id where ea.AttributeTypeId = @typeId order by ea.{0} {1}", columnName, descending ? "desc" : "asc"); var query = ObjectContext.CreateQuery<SomeEntity>(queryESQL, new ObjectParameter("typeId", attributeTypeId)); Tables have following structure: <Attribute>: int Id; decimal DecimalColumn; string

Entity Framework & LINQ To SQL - Conflict of interest?

核能气质少年 提交于 2019-12-02 19:33:58
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 queries. Now, since the underlying implementation (and since SQL Server is not yet an ODBMS) is still a Relational store, at some point the Entity framework has to make the translation into SQL queries. Why not fix the Linq to SQL issues (m:m relationships, only SQL server support etc.) and use Linq to SQL in as the layer that generates these queries

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

依然范特西╮ 提交于 2019-12-01 13:14:23
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 be achievable in other ways... To try and figure it out myself, I created a very simple entity model using the Employee and EmployeePayHistory tables from the AdventureWorks database. One example I saw online demonstrated something similar to the following Entity SQL: SELECT VALUE DEREF(CREATEREF(AdventureWorksEntities3.Employee, row(h.EmployeeID)))

Performance of Linq to Entities vs ESQL

£可爱£侵袭症+ 提交于 2019-11-27 18:24:23
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 would like to get a full idea of the pro's/con's of using either method. The most obvious differences are: Linq to Entities is strongly typed code including nice query comprehension syntax. The fact that the “from” comes before the “select” allows IntelliSense to help you. Entity SQL uses traditional string based queries with a more familiar SQL like

Performance of Linq to Entities vs ESQL

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 19:25:37
问题 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 would like to get a full idea of the pro's/con's of using either method. 回答1: The most obvious differences are: Linq to Entities is strongly typed code including nice query comprehension syntax. The fact that the “from” comes before the “select”