Building the Calculator Tab
The last area of functionality we have to build is the Calculator tab. I have started by creating a couple of view model classes in the Models/View
folder. The classes are called CalcData
and CalcResult
and are shown in Listing 31-39.
Listing 31-39. View model classes to support the Calculator tab
using System.ComponentModel.DataAnnotations;
namespace TriathlonApp.Models.View {
public class CalcData {
public CalcData() {
Laps = 80;
PoolLength = 20;
Minutes = 60;
CalsPerHour = 1070;
}
[Required]
[Range(1, 500)]
public int Laps { get; set; }
[Required]
[Range(10, 500)] public int PoolLength { get; set; ...
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.