ADO.NET Entity Framework - Orcas Beta 1

Published 20 April 07 06:02 PM | dpblogs 

 

What else do you need to know about the Entity Framework?  We've documented basic syntax and provided a few samples.  How can we improve the documentation?  Send us scenarios you want to implement.

 

Orcas Beta 1 contains the ADO.NET Entity Framework.  This technology requires new ways of thinking about data applications.  The documentation included with Beta 1 introduces design concepts and provides examples to get you up and running as quickly as possible.  The ADO.NET team blog will help to answer questions that remain after you've read enough of the documentation to implement an Entity Data Model and write some code using the Entity Client.

 

We want to answer your questions.  As you begin to work with the Entity Framework, add your comments to this post or one of the others on this blog that target specific features of the Entity Framework.  This is a direct connection to the people who designed the Entity Framework.  You can get answers to your questions and save time getting past the difficulties of working with new technology.  The questions you raise will generate a lot of discussion at Microsoft.  You'll get fast answers and help us make the next release of the Entity Framework easier to use.

 

Are there any particular features of the Entity Framework that need more documentation?  In order to implement the examples in the documentation, the writers on this project resolved many of the coding issues you will encounter as you experiment with this framework.  How can we make it easier for you to understand schema syntax and application code?

 

Tell us about the data applications you want to implement.  Which scenarios for using this framework interest you most?  The entity data model exists to increase your productivity.  Using this model, you can resolve data access issues and concentrate directly on application scenarios.  Tell us how we can help you get started.  Your questions will get fast answers, and your feedback will improve the next release of the Entity Framework.

 

Mike Dodaro

Programmer/ Writer

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Guy Burstein said on April 21, 2007 1:52 AM:

Hi,

I would like to know when will the EDM Designer be released? I can't find it in Beta 1...

Thanks,

Guy Burstein

# Amber said on April 21, 2007 9:07 AM:

Does Visual Studio Orcas Express Editions have full support for ADO.NET Entity Framework, including desiging tools?

# Koistya `Navin said on April 21, 2007 9:59 AM:

I am interested how it is possilbe to implement paging functionality using LINQ to SQL

For example:

int totalRecordsCount;

INumerable<Product> products = from p in db.Products

                                                     where p.Name.StartsWith("A")

                                                     select p

                                                     limit(0, 10),

                                                     out totalRecordsCount;

# Eric said on April 21, 2007 10:31 AM:

When I add an ADO.NET EDM file to my project and select the tables from my schema, I get nothing but an empty .csdl file.  No entities are mapped or generated.  It makes no difference how many tables I select.  The March CTP was at least stable enough to generate a functional EDM from a relational DB, what happened with Beta 1?

# Michael said on April 21, 2007 1:45 PM:

Using the C# Express Beta 1 I am having similar experiences to what others have said. I can't find any type of designer. In addition, my .csdl files are essentially blank. They contain no mapped entities.

# EL said on April 21, 2007 7:18 PM:

This is bad...

Very, very bad...

Even the walkthroughs in the documentation are producing empty csdl files.  

I can generate a mapping schema manually using the System.Data.Entity.Design namespace, but when I run the class generator against the csdl file ( Runtime Version:2.0.50727.1304), I get the following error:

Error 4 Custom tool error: The element Schema in namespace http://schemas.microsoft.com/ado/2006/04/edm/ssdl">http://schemas.microsoft.com/ado/2006/04/edm/ssdl was unexpected for the root element. Expected Schema in namespace http://schemas.microsoft.com/ado/2006/04/edm. C:\Dev\src\Zentities\WindowsApplication1\Model1.csdl 1 1 WindowsApplication1

I'm building smart-client using sync-services with SqlCE, (but I run the EDM wizard against a SQLServer '05 DB), I cannot circumvent the need for EDM as it comprises my primary data layer on both the client and server modules.

After spending the better part of a day un-installing the March CTP and getting Beta 1 configured, I would hate to think any of the following are true:

1: I have to go back to the quircky March CTP to continue working.

2: I have to manual write pages upon pages of XML to create my own EDM which I would have to manually maintain and update whenever my data model changes.

Please, please, please address this ASAP!  My entire data layer is riding on this!

Thanks for all your great work!!!

# pushpushpop said on April 22, 2007 1:49 AM:

The console Utility (EdmGen.exe) still works so I'm guessing it's an issue with the IDE.

# Ivan said on April 22, 2007 5:04 AM:

As others have pointed out, the Orcas Beta 1 EDM wizard generates almost blank files. I tried doing the quickstart from the documentation but can't generate the model using the IDE wizard.

# Mike Dodaro said on April 22, 2007 7:11 AM:

In some installations the tools for building schemas and entities apparently do not connect properly to the Orcas IDE.  In these cases you can use the tools from the command line.  The first tool, EDMGen.exe, will generate *.csdl, *.ssdl, and *.msl schemas from a database on a SQL Server. The second tool, EntityClassGenerator.exe, is used to generate the c# code that is used to build the dll.

Run each tool with the /? switch to get full command syntax.

After you run EdmGen.exe on the .csdl schema, you can use the c# code generated in a class library project to build the dll.  You'll need a reference to System.Data.Entity.dll.

The tools for designing and building entities are still in development at the time of this release.  

# pushpushpop said on April 22, 2007 4:25 PM:

Bigger issue here:

SQL Server Compact Edition + Server Explorer:

When creating or opening a connection:

"Unable to find the requested .NET Framework Data Provider.  It may not be installed."

"Test Connection" returns "Successful", and I can also connect to SSCE programmatically.

I did have a previous version of Orcas (March CTP) installed which I removed.  I uninstalled everything related to VS as per the instructions here:

http://download.microsoft.com/download/9/f/7/9f79d1d8-72fd-407c-88f7-d2254eb4e0ad/VSNETSDKcontents.htm

Then re-installed the Beta 1 release.

There was no change to the behavior:  

"Unable to find the requested .NET Framework Data Provider.  It may not be installed."

I followed the instructions regarding the machine.config fix/workaround as detailed here:

http://oakleafblog.blogspot.com/2007/03/orcas-march-ctp-on-vista-database.html

I am unable to integrate Sync Services without connecting  to SSCE.  This issue was not present in the March CTP.

Can you confirm this is a problem with the beta release?

# JP said on April 22, 2007 6:22 PM:

The EDMGen tool does not generate properties for fields of type image or text, are they not supported yet?

# megame said on April 22, 2007 6:58 PM:

Support for sql_variant is missing, is this in works or are you not going to support it in v1?

# rogerj said on April 22, 2007 7:18 PM:

1. A "What's New in Beta 1" post, similar to that by the XML Team is needed (see http://blogs.msdn.com/xmlteam/archive/2007/04/20/linq-to-xml-changes-in-orcas-beta1.aspx).

2. A detailed known bugs list is an absolute necessity, with estimates of when the bugs might be fixed.

3. Your I\intention to provide interim CTPs for fixes and missing features needs to be spelled out.

--rj

# Mike Kaufman (Microsoft) said on April 22, 2007 11:12 PM:

We discovered late friday that there were some changes in the VS wizard framework for beta 1, and these caused the EDM wizard to generate empty models.  We have a fix coded, and we are working through the logistics of releasing this.

Sorry for the inconvenience.

Mike Kaufman

Microsoft Corp.

# Jas Sahota said on April 23, 2007 12:57 AM:

Thanks Mike, look forward to it.

# Glenn Gailey [Microsoft] said on April 23, 2007 5:04 AM:

Until we get the issue with the Entity Data Model Wizard resolved in Beta 1, you can still complete the quickstart by using the following command line to generate the the mapping files for the School database using the EdmGen.exe tool:

edmgen.exe /mode:fullgeneration /c:"Data Source=YourServer; Initial Catalog=School; Integrated Security=SSPI" /project:School /entitycontainer:SchoolEntities

/language:CSharp /namespace:SchoolModel

Replace “YourServerName’ with the name of your database server. For VB files, replace CSharp with VB.

Glenn Gailey

Data Programmability User Education

This posting is provided "AS IS" with no warranties, and confers no rights.

# David Jacobson said on April 23, 2007 8:41 AM:

Where is the documentation?  The version of the MSDN doucmentation that comes with C# express contains essentially no documentation of the entity framework and very little documentation of LINQ as a whole.  The LINQ documentation that has come with earlier CTP's (May 2006)is exceptionally good.  But all I can find for the entity framework are the papers from May and June 2006.  I cannot find any documentation available for download on entity SQL.  It may be in the recent CTP's.  But those are not installable on my Vista machine.

# Mesan said on April 23, 2007 10:01 AM:

How about documentation on getting it to work with a DB2 database?

# dpblogs said on April 23, 2007 12:54 PM:

Mesan,

We are working closely with many DB vendors, including IBM, to help them update their ADO.NET providers to support the Entity Framework.  Unfortunately, I do not have any information as to when they may release a new provider.

Thank you,

Elisa Johnson

Program Manager, Microsoft Data Programmability

# Mike Dodaro said on April 23, 2007 2:14 PM:

Some of these questions are beyond the scope of this post.  Installation issues may be resolved faster by posting to the ADO.NET Forum.  The forum can be found at the following url: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=533&SiteID=1

# Mike Dodaro said on April 23, 2007 6:04 PM:

The Entity Framework documentation is not included in installations of the Express edition of Orcas Beta 1.  To get the compete documentation install the Orcas SKU from here : http://msdn2.microsoft.com/en-us/vstudio/default.aspx

In a few days the documentation for ADO.NET and Entity Framework should be available on MSDN.  Current ETA: Wednesday, April 25, 2007.

# Mike Dodaro said on April 25, 2007 12:46 AM:

The ADO.NET documentation is now available on MSDN at the following url: http://msdn2.microsoft.com/en-us/library/e80y5yhx(VS.90).aspx

# David Jacobson said on April 25, 2007 3:42 PM:

So it seems that as of Orcas beta one the express editions basically do not support linq for entities.  The samples can be compiled and work.  But the tool for building the mapping and schema files (edmGen.exe) is not included.  Is this the release plan?

# Mike Kaufman (Microsoft) said on April 26, 2007 12:28 PM:

Hi David -

For Orcas Beta1, edmgen.exe should be at "%windir%\Microsoft.net\Framework\v3.5.20404\edmgen.exe"

Can you check to see if it is in that location?

Thanks,

Mike

# Corey said on April 28, 2007 11:57 PM:

I would like to see a sample for hosting a WCF service exposing the Entity layer for AdventureWorks.

# David Boschmans Weblog said on May 10, 2007 7:45 AM:

Beside Project "Astoria" we also announced Project code named "Jasper" at Mix07 last week. Project Codename

# Scott Lloyd said on May 20, 2007 4:47 AM:

Glenn Gailey,

Thank you for taking your time to post that comment. I was playing with the ADO.Net Entity Model today for the first time and was boggled by why the tool seemed to execute without error but generated no code. I thought maybe I ust misunderstood what the thing did. Then I happened across the School sample in the help and decided to build the project but again, the tool generated an empty shell and the sample refused to build. Luckily, I ran across your comment and was able to get it to work. I must add, though, that the developer will then have to manually add all of the .CS files into the project. Again, thank you. If I didn't run into your comment I might have given up on the Entity Model until Beta 2 or the actual release of Orcas.

Scott Lloyd

Lloyd Software Development

# Scott Lloyd said on May 20, 2007 4:48 AM:

Oh yeah... Project Astoria looks amazing, BTW. All I can say is WOW! This is the first I've heard of it.

Scott Lloyd

Lloyd Software Development

# wlagraba said on May 30, 2007 2:44 PM:

I have a feature request for LINQ to Entities. Please add composability of ObjectQuery upon ObjectQuery, just like IQueryable upon IQueryable. I need to be able to extend the final query (that goes to the database) using LINQ to Entities.

Following is an example of what I'm talking about.

If I have the following tables:

  Orders and OrderDetails

I can define a LINQ to SQL query like this

  var qry = from r1 in db.Orders

          from r2 in db.OrderDetails

          where r1.orderid == r2.orderid

          select r1.orderid;

But also can define the following extension query in a partial class that has the same name as the DataContext. This way this new method becomes an extension to the model and looks just as natural as the other tables with the exception that is a method and not a property:

public partial class Northwind

{

  public IQueryable<Orders> ValidOrders( System.DateTime pFrom, System.DateTime pThrough )

  {

     return from row in this.Orders

            where orderdate >= pFrom

            && orderdate <= pThrough

            select row;

  }

}

and I can use it as a table in a query:

var qry = from r1 in db.ValidOrders( DateTime.Parse("1/1/2006"), DateTime.Parse("12/31/2006") )

          from r2 in db.OrderDetails

          where r1.orderid == r2.orderid

          select r1.orderid;

I can NOT do that with Entities and I really think this is necessary to create tables that enforce some data level business logic and simplify programming like Views, but that are not subjected to the same restrictions (i.e. View of a join of multiple tables that accepts INSERT).

# Mike Taulty's Blog said on June 19, 2007 9:34 AM:

I saw a question over here about "How do I implement paging of data in LINQ to SQL". For me, this...

# Andy said on September 16, 2009 4:50 PM:

I second "megame's" request for sql_variant support in EF 4.  We have to use LINQ-to-SQL to access sql_variants but rest of our code base is based on EF.  As you can imagine, having to use both LINQ-to-SQL and LINQ-to-Entities day-to-day is enough to drive a developer mad.  So please add sql_variant (to object) to EF 4 before RTM.  And also please ASAP combine LINQ-to-SQL and LINQ-to-Entities to end the madness and confusion out there about which to use when.

Thanks!

-Andy

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required

Search

This Blog

Syndication

Page view tracker