ErrorViewModel.cs, this project creates a model file Book.cs by performing the folllowing tasks.
Select the template :
Book.cs into the folder with some properties: ⇒ ⇒ ⇒
|
using System.ComponentModel.DataAnnotations;
namespace BookStore1.Models {
public class Book {
[ Key ]
[ Required ]
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 |