O'Reilly logo

ASP.NET MVC 4 Mobile App Development by Andy Meadows

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

SOLIDifying BrewHow

Let's apply what we now know about the SOLID class design to our app. Given that abstractions are important in SOLID design, we will begin by adding abstractions for our repositories.

Adding interfaces

In .NET, we create an abstraction through an interface and provide a concrete implementation of an abstraction through a class, so our first step should be providing interfaces for our classes.

Open Visual Studio and add new files, namely IRecipeRepository, IStyleRepository, and IReviewRepository in the Repositories folder of our project to hold the interface for each repository in the app. The extracted interfaces for IRecipeRepository is as follows:

public interface IRecipeRepository { IQueryable<RecipeEntity> GetRecipes(); IQueryable<RecipeEntity> ...

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