Creating the Event Controller

As I mentioned, the Event controller will be the entry point into the application, so I have created a new controller class called EventController in the Controllers project folder (see Listing 31-12).

Listing 31-12. The initial version of the EventController class

using System.Linq; using System.Web.Mvc; using TriathlonApp.Models.Domain; using TriathlonApp.Models.Domain.Repository; namespace TriathlonApp.Controllers {     public class EventController : Controller {         private IRepository repository;         public EventController(IRepository repo) {             repository = repo;         }         public ActionResult Index() {             return View();         }     } }

In applications that have a common ...

Get Applied ASP.NET 4 in Context now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.