mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-26 19:47:30 +00:00
Beginning React+Redux "Music Store" sample
This commit is contained in:
40
samples/react/MusicStore/Apis/Models/Album.cs
Normal file
40
samples/react/MusicStore/Apis/Models/Album.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MusicStore.Models
|
||||
{
|
||||
public class Album
|
||||
{
|
||||
public Album()
|
||||
{
|
||||
// TODO: Temporary hack to populate the orderdetails until EF does this automatically.
|
||||
OrderDetails = new List<OrderDetail>();
|
||||
}
|
||||
|
||||
[ScaffoldColumn(false)]
|
||||
public int AlbumId { get; set; }
|
||||
|
||||
public int GenreId { get; set; }
|
||||
|
||||
public int ArtistId { get; set; }
|
||||
|
||||
[Required]
|
||||
[StringLength(160, MinimumLength = 2)]
|
||||
public string Title { get; set; }
|
||||
|
||||
[Required]
|
||||
[RangeAttribute(typeof(double), "0.01", "100")] // Long-form constructor to work around https://github.com/dotnet/coreclr/issues/2172
|
||||
[DataType(DataType.Currency)]
|
||||
public decimal Price { get; set; }
|
||||
|
||||
[Display(Name = "Album Art URL")]
|
||||
[StringLength(1024)]
|
||||
public string AlbumArtUrl { get; set; }
|
||||
|
||||
public virtual Genre Genre { get; set; }
|
||||
|
||||
public virtual Artist Artist { get; set; }
|
||||
|
||||
public virtual ICollection<OrderDetail> OrderDetails { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user