Question: THIS INFO BELOW IS WHAT I WAS PROVIDED. PLEASE SEE QUESTION AT VERY BOTTOM IN BOLD You've been provided a starting project. The Album and

THIS INFO BELOW IS WHAT I WAS PROVIDED. PLEASE SEE QUESTION AT VERY BOTTOM IN BOLD

You've been provided a starting project. The Album and Publisher models have been created as well as the IAlbumList, AlbumList, IPublisherList and PublisherList. These have been registered with services Container and are ready to be injected. I Will attach all the data below for your reference

ALBUMS.CS

//If property is named Id //.Net assumes this is the primary key [Key] public int Id { get; set; } //This means they have to type an album title [Required(ErrorMessage = "Album Title cannot be blank")] [Display(Name = "Album Title")] public string Title { get; set; } [StringLength(50, ErrorMessage = "Artist cannot be more than 50 characters")] public string Artist { get; set; } [Required(ErrorMessage = "Genre cannot be blank")] public string Genre { get; set; } [Required(ErrorMessage = "Price cannot be blank")] //This means price can have 5 total digits and two past the decimal point [Column(TypeName = "decimal(5, 2)")] //Range Attribute takes a starting and an upperbound and it will check //that Price is in this range [Range(0, 999.99)] public decimal Price { get; set; } public int PublisherId { get; set; }

PUBLISHER.CS

public class Publisher { public int Id { get; set; } public string Name { get; set; } public string City { get; set; } public string Country { get; set; } }

IALBUMLIST.CS

public interface IAlbumList { List GetAlbums(); }

ALBUMLIST.CS

public class AlbumList : IAlbumList { int idCounter = 1; List albums; Random rand = new Random(); public AlbumList() { albums = new List { new Album { Id = idCounter++, Title = "The Best Of Men At Work", Genre = "Rock", Price = (decimal)3.99 + 2 * (idCounter % 10), Artist = "Men At Work", PublisherId = rand.Next(1, 6)}, new Album { Id = idCounter++, Title = "A Copland Celebration, Vol. I", Genre = "Classical", Price = (decimal)3.99 + 2 * (idCounter % 10), Artist = "Aaron Copland & London Symphony Orchestra", PublisherId = rand.Next(1, 6)},

IPUBLISHERLIST.CS

public interface IPublisherList { List GetPublishers(); } }

PUBLISHERLIST.CS

public class PublisherList : IPublisherList { List publishers;

public PublisherList() { publishers = new List { new Publisher{Id = 1, City = "Los Angeles", Country = "United States", Name = "Universal Records"}, new Publisher{Id = 2, City = "New York", Country = "United States", Name = "Empire"},

};

public List GetPublishers() { return publishers; }

Create an AlbumController with the following actions and views:

A. Use dependency injection to add the AlbumList and the PublisherList to the controller

B. Index() endpoint - Shows each of the albums info in a view. This have 5 parts

1. Provide links to the following actions for each album

2. Edit, Details, Delete

3. Add a select to the top of the view with each distinct price that will filter by price when the user chooses a price

4. Include the name of the publisher for each album on the Index View

5. Add a select to the top of the view and each distinct publisher that will filter publisher when the user chooses a publisher

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!