Code-First with Entity Framework 4 and ASP.NET Web Pages

Scott Guthrie and Scott Hanselman have written great blog posts about how to use the new Code-First functionality in the latest Entity Framework CTP. But what about ASP.NET Web Pages?

Entity Framework 4 requires .NET 4.0, and since ASP.NET Web Pages is built on .NET 4.0 it should work, and it does! ASP.NET Web Pages is just not classic ASP on steroids, it´s the full .NET 4.0 made simple. Smile

I posted the code you need and how to do it as an answer on the ASP.NET Forums here:

http://forums.asp.net/t/1580303.aspx

When the database is generated, you can edit the data in the built-in database manager in WebMatrix.

2 Comments

  • Hi Mikael!

    Since WebMatrix Beta 2 release RecreateDatabaseIfModelChanges isn't working anymore :/ There's no immediate changes in DB file when I change model classes.

    Do you know what can I do about it?
    Thanks in advance!

  • I solved a problem with installing SQL Server CE 4.0 CTP1 over CTP2 which was installed during WebMatrix Beta 2 release. Weird stuff.

Comments have been disabled for this content.