Category Archives: Entity Framework

Entity Framework 5 easier way to update record

In the past with EF if you wanted to update a record you would need to do something like this:

Posted in Entity Framework, Web | Tagged , | 2 Comments

Create a dynamic where clause using Linq

The scenario that came up today was this.  A data entry application has the following fields, FirstName, LastName, and EmailAddress.

Posted in Entity Framework, Linq | Tagged , | 3 Comments

CS0012: The type ‘System.Data.Spatial.DbGeography’ in Entity Framework and MVC

Last night I was working on a MVC4 project.  Utilizing Entity Framework 5’s new DBGeography when adding the field to the MVC view I received the following error:

Posted in Entity Framework, MVC | Tagged , | 1 Comment

MVC display an image that is stored as a byte array

  So the scenario is; how do we retrieve images that are stored in a database as a byte array and display them on a page utilizing Asp.net MVC.  The major hurtle that needs to be overcome is that a … Continue reading

Posted in Entity Framework, MVC | Tagged , , | 5 Comments

DatabaseGeneratedOption does not Exist error after upgrading to Entity Framework 5.x RC or .NET Framework 4.5

Like so many others over the weekend I upgraded to the last RC builds of various Visual Studio 2012 related products.  While updating my Web Api sample project ChlodnyWebApi I ran into one error when upgrading to Entity Framework 5 … Continue reading

Posted in Entity Framework | Tagged | Comments Off on DatabaseGeneratedOption does not Exist error after upgrading to Entity Framework 5.x RC or .NET Framework 4.5

Released Entity Framework Power Tools Beta 2

A few weeks ago I demo’d how to reverse engineer an existing database using the Entity Framework Power tools Beta 1.  A few days ago (9th of April) the EF team  released an update to that tool setup with some … Continue reading

Posted in Entity Framework | Tagged | 1 Comment

SWFL .NET Developer User Group Presentation: Entity Framework Code First, Asp.Net Web Api, and HTML/jQuery

For the month of March I was the presenter at the SWFL .NET Developer User group.  I am either getting better at this stuff or they are just really loving to be punished.  A big shout out and thanks to … Continue reading

Posted in Entity Framework, MVC, Web | Tagged , , , | Comments Off on SWFL .NET Developer User Group Presentation: Entity Framework Code First, Asp.Net Web Api, and HTML/jQuery

Chlodny series Day 5: Brief: What is ASP.NET Web API?

ASP.NET Web API is the new product born from WCF for jQuery.  Web API allows services to be created over HTTP rather then utilizing a service contract (SOAP or WS). Web API  creates an avenue for developers to expose data … Continue reading

Posted in Entity Framework, MVC, Web | Tagged , , , , | Comments Off on Chlodny series Day 5: Brief: What is ASP.NET Web API?

Chlodny series Day 4: Entity Framework Code First Migration

Before Entity Framework Code First Migration was introduced in version 4.3.  Developers had a few options if the domain model was different from the database schema. CreateDatabaseIfNotExists : Pretty self explanatory, if on application start Entity Framework cannot find the … Continue reading

Posted in Entity Framework, MVC, Web | Tagged , , , , | Comments Off on Chlodny series Day 4: Entity Framework Code First Migration

Chlodny series Day 3: Connect Web Api to Entity Framework

Now that the existing database has been reversed engineered and the domain classes are set, it is time to wire up those domain classes to the main project. Add the DataAccess project to the ChlodnyWebApi project.

Posted in Entity Framework, MVC, Web | Tagged , , , , | 1 Comment