PageRenderTime 4ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/MvcMusicStore/Models/Album.cs

#
C# | 37 lines | 30 code | 7 blank | 0 comment | 0 complexity | 6a06c0c67c711344aa5a5ea0662d7e3a MD5 | raw file
 1using System.ComponentModel;
 2using System.ComponentModel.DataAnnotations;
 3using System.Web.Mvc;
 4using System.Collections.Generic;
 5
 6namespace MvcMusicStore.Models
 7{
 8    [Bind(Exclude = "AlbumId")]
 9    public class Album
10    {
11        [ScaffoldColumn(false)]
12        public int AlbumId { get; set; }
13
14        [DisplayName("Genre")]
15        public int GenreId { get; set; }
16
17        [DisplayName("Artist")]
18        public int ArtistId { get; set; }
19
20        [Required(ErrorMessage = "An Album Title is required")]
21        [StringLength(160)]
22        public string Title { get; set; }
23
24        [Required(ErrorMessage = "Price is required")]
25        [Range(0.01, 100.00,
26            ErrorMessage = "Price must be between 0.01 and 100.00")]
27        public decimal Price { get; set; }
28
29        [DisplayName("Album Art URL")]
30        [StringLength(1024)]
31        public string AlbumArtUrl { get; set; }
32
33        public virtual Genre Genre { get; set; }
34        public virtual Artist Artist { get; set; }
35        public virtual List<OrderDetail> OrderDetails { get; set; }
36    }
37}