The Edm.Length() Canonical Function over SqlClient

I recently blogged about canonical functions in Entity Framework and SQL Server’s LEN() function. The purpose of those two posts was to lay out the foundation for this one, and to allow it to be brief and coherent. Please read those two posts before proceeding.   If you’ve been using the Edm.Length() canonical function from…

2

eSqlBlast – The Ultimate Tool for Writing Entity SQL Queries

2007.12.18: Today I posted an update to How to Parse an EntityDataReader – I discovered (and fixed) two bugs in the parsing code. Since the code is taken from eSqlBlast, the same fix should be applied to it too. The code is in project Core, class XmlVisitor, method VisitRecord. I’ll try to push a refresh to CodePlex soon. Sorry…

1

Entity SQL: Canonical Functions

Canonical functions were introduced in the Beta 2 release of Entity Framework. Their purpose is to expose a [virtually] canonical API beyond the core language constructs. Consumers of canonical functions should be aware that Entity Framework defines only the “syntax” part of the API. The behavior is entirely up to the store provider. Not the…

7

How to Get the Native SQL from an EntityCommand

With the Beta 3 release, Entity Framework is introducing an easy way to get the native SQL from an EntityCommand. There was public API to get to the native SQL, but the pattern was too obscure, and I don’t want to go into detail. Let’s discuss the new one, instead. It’s a single method directly…

4

How to Do Custom Mapping Using Entity SQL Views

This post was intended to be a reply to this question http://forums.microsoft.com/msdn/showpost.aspx?postid=2440161&siteid=1 on the Entity Framework forum, but its size exceeds the forum server limit. Besides, it’s useful in general. So I decided to post it here. In this post you’ll find an entire repro of the subject scenario from the forum.   Create the…

1

How to Parse an EntityDataReader

2007.12.18: Please accept my apologies – today I discovered (and fixed) two bugs in the parsing code. One is a silly error. The other is that collections should be treated as primitive types and refs with regard to the number of fields. The code bellow includes the changes.   2007.12.04: Last week I discovered that…

2

Entity SQL Tip #1

A well defined query against a well defined entity data model does not need JOIN.   Navigation properties in combination with nesting sub-queries should be used instead. These latter constructs represent task requirements much more closely than JOIN does. That makes it easier to build and maintain correct Entity SQL queries.    


Entity SQL – Quick Reference

  Literals   “abc” Value abc ‘abc’ Value abc 1 Value 1 {2} Value 2 {3, 4, 5} Value 3 4 5 Rows   ROW(1 AS i, ‘abc’ AS s) i s 1 abc SELECT ROW(1 AS i, ‘abc’ AS s) AS Row FROM {11, 12, 13}; Row i s 1 abc i s 1…

1

Entity SQL

ADO.NET’s Entity Client comes with a client-side query engine that provides a consistent entity-level platform over different store providers. The input to that query engine is an entity-level query written in a language naturally called Entity SQL. The purpose of Entity SQL is to provide a common, entity-level, query language independent of any data store,…

1