Geeks With Blogs
Title Of Blog Entity Framework
Entity Framework 4 - When you can use Parameterized Constructors in Select
Skip to the bottom if want the quick answer ;-) Just a quick note on something I ran into today... I've taken to utilizing a View Model in which objects are created on a 1 to 1 basis to hold entities supplying data to the View/UI. As such, I modified my existing linq queries such that the View Model objects are created in the select portion of the query resulting in an enumerable list I can supply to the View. Below is an example: IQueryable<sessionfoo> fooquery = ((IEnumerable<sessionfoo... ......

Posted On Thursday, September 22, 2011 3:09 PM

Entity Framework 4 - Generating Entities based on Views
Just a quick post regarding a common issue and fix... When attempting to add a view as an entity to your model the EF generator may complain that it is unable to find or infer a primary key on your view. As a result, it will not add it to the model. The quick fix is to add the following to which ever column you wish to be the primary key within your view: ISNLL(TableA.ColumnA, -999) myPrimaryKeyColumnName Adding this will allow the EF generator to infer the primary key and add the view as an entity ......

Posted On Tuesday, June 28, 2011 10:13 AM

Copyright © Jake Rutherford | Powered by: GeeksWithBlogs.net | Join free