O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

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

Creating the Model

Most projects start with the model. For this application, I am working with a preexisting database, so my model objects will simply represent the database tables. I created a new folder called Models/Domain and created the model classes. Listing 31-1 shows the Event class, which will represent rows of data in the Events database table.

Listing 31-1. The Event domain model class

using System; namespace TriathlonApp.Models.Domain {     public class Event {         public int ID { get; set; }         public DateTime Date { get; set; }         public string Athlete { get; set; }         public string Type { get; set; }         public TimeSpan SwimTime { get; set; }         public TimeSpan CycleTime { get; set; }         public ...

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