O'Reilly logo

Secrets of Real World ASP.NET Dynamic Data Web Sites by Craig Shoemaker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.5. Move the Data Context to a Separate Assembly

Often web applications architecturally consist of more than just the user interface layer, or the ASP.NET web site project. Most Dynamic Data demonstrations guide developers to place the database models in the App_Code folder. This practice violates modern programming practices of "not mingling user interface code with application code."

The following exercise will remove the data context from the user interface layer into a class library. Placing the database models at this level allows the web site as well as a Web Service, client application, console application, or any other type of UI layer to harness the business logic in the data context.

Begin by adding a new project to the solution by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required