chap4.1: Modeling the Music Store
parent
ccba65247b
commit
4943788e23
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace MvcMusicStore.Models
|
||||
{
|
||||
public class Album
|
||||
{
|
||||
public virtual int AlbumId { get; set; }
|
||||
public virtual int GenreId { get; set; }
|
||||
public virtual int ArtistId { get; set; }
|
||||
public virtual string Title { get; set; }
|
||||
public virtual decimal Price { get; set; }
|
||||
public virtual string AlbumArtUrl { get; set; }
|
||||
public virtual Genre Genre { get; set; }
|
||||
public virtual Artist Artist { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace MvcMusicStore.Models
|
||||
{
|
||||
public class Artist
|
||||
{
|
||||
public virtual int ArtistId { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
namespace MvcMusicStore.Models
|
||||
{
|
||||
public class Genre
|
||||
{
|
||||
public virtual int GenreId { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Description { get; set; }
|
||||
public virtual List<Album> Albums { get; set; }
|
||||
}
|
||||
}
|
|
@ -125,6 +125,9 @@
|
|||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\Album.cs" />
|
||||
<Compile Include="Models\Artist.cs" />
|
||||
<Compile Include="Models\Genre.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -166,7 +169,6 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Views\Store\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in New Issue