If you are like any other coder, cutting and pasting snippets should put up a red flag in your mind. You will quickly hit this threshold when creating CRUD-services for MVC 4 applications
over and over again. This lead me to create a repository pattern using generic types and base controller classes that I would like to share with you. In the end, below is how my Web API classes look like, which automatically give me
create, retrieve, update, and delete functionality:
using MvcWebApp.Helpers;
using MvcWebApp.Models.Data;
namespace MvcWebApp.Api
{
public class SpeakersController : BaseApiController<Speaker>
{
//THIS ...