ErrorViewModel.cs
, this project creates a model file Book.cs
by performing the folllowing tasks.
Select the template :
⇒ ⇒ ⇒
|
using System.ComponentModel.DataAnnotations; namespace BookStore1.Models { public class Book { public int Id { get; set; } [ Display( Name = "Book Title" ) ] [ Required ] public string Title { get; set; } public string Genre { get; set; } [ DataType( DataType.Currency ) ] [ Range( 1, 100 ) ] public decimal Price { get; set; } [ Display( Name = "Publish Date" ) ] [ DataType( DataType.Date ) ] public DateTime PublishDate { get; set; } } } |
“It’s amazing how email has changed our lives. You ever get a handwritten letter in the mail today? ‘What the? Has someone been kidnapped?’” — Jim Gaffigan |