O'Reilly logo

ASP.NET MVC 2 Cookbook by Richard Kimber, Andrew Siemer

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

Exposing an application API to your presentation layer

If you work in a team of varied levels of skill, you might find the need to make some of the more complex aspects of your application easier to consume. While you could create a series of wrapper classes, factories, and repositories, junior developers might find their lives to be easier if they had a single point of entry to your application. It is surprisingly easy to create a super wrapper for all the functionality of your application and then expose it throughout the presentation layer of your website. Creating such an API is the topic of this recipe.

How to do it...

  1. Create a new default ASP.NET MVC 2 application.
  2. Then we will create several base classes, which we will use to insert an extension ...

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