Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Entity Framework - Entity Provider Level. Entity SQL - USING.
Mike Taulty's Blog

Mike's Badges

Follow on Twitter
View mike's profile on slideshare
Add to Technorati Favorites
CW Blog Awards

Returning back to that list that I talked about in a previous post, we had

ANYELEMENT,CREATEREF, DEREF, IS OF, KEY, MULTISET, NAVIGATE, OFTYPE, OVERLAPS, Projection (including here as I've not yet figured out what it is :-)), REF, ROW , SELECT (including here because it has some weirdness like VALUE), SET, TREAT, USING

For this post, let's take a look at;

USING

This is a funny one. It's a way of introducing namespaces just like in C#.

So, if I want to construct an instance of my Northwind.Shippers entity (Northwind being the namespace that's defined in my CSDL file) then I can do;

Northwind.Shippers(1, 'Acme', '123 456 789')

and the USING statement can make that more compact for me by allowing me to do;

Using Northwind;
Shippers(1, 'Acme', '123 456 789')

and, kind of like C#, I can also define aliases such as;

Using x=Northwind;
x.Shippers(1, 'Acme', '123 456 789')

but, as far as I can tell, you can't do this kind of trick;

Using myShipper=Northwind.Shippers;
myShipper(1, 'Acme', '123 456 789')

but that doesn't seem like the end of the world :-)


Posted Mon, Aug 27 2007 3:57 PM by mtaulty

Comments

Mike Taulty's Blog wrote ADO.NET Entity Framework - Bringing Together A Few Previous Posts
on Wed, Aug 29 2007 5:37 PM
This is just a convenience - links to the posts that I've made so far around beta 2 of the ADO.NET Entity...
Entity Framework from Mike Taulty « vincenthome’s Software Development wrote Entity Framework from Mike Taulty « vincenthome’s Software Development
on Fri, Sep 7 2007 7:25 AM
(C) Mike Taulty, 2009. All rights reserved. The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems