Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Create view models and mappers that cover the initial use cases Album, MediaType, Artist entity view models The following use cases will need view models

Create view models and mappers that cover the initial use cases Album, MediaType, Artist entity view models

  • The following use cases will need view models so go ahead and write them (AlbumBaseViewModel,
    MediaTypeBaseViewModel, and ArtistBaseViewModel). None of these "...Base" classes will have navigation properties
    and none of these will have composed (AutoMapper flattened) properties. Keep them simple.
    • Artist - "get all"
    • Album - "get all"
    • MediaType - "get all"

Track entity view model classes
 

  • For the track entity, we will support the following use cases:
    • Track - "get all"
    • Track - "get one"
  • The TrackBaseViewModel class needs many of the track entity's properties but not all
    of them - for example, you can ignore the navigation properties and the MediaTypeId
    and GenreId properties.
  • You will also add a TrackWithDetailViewModel class. It will have a navigation property
    to MediaTypeBaseViewModel. It will also have string properties (AutoMapper
    flattened) for the associated album and artist descriptive data.
    Later, we will need two view model classes, TrackAddFormViewModel and
    TrackAddViewModel, to support the use case:
    • Track - "add new"

Playlist entity view model classes

  • In this assignment, you will enable basic editing of a playlist. The following image is an example of what you may end up with after you have completed the assignment.
  • In the image, you will see two lists of tracks. The list on the left shows all tracks, whether on the playlist or not, and includes the track name, composer, track time/length, and unit price. The list on the right shows a list of existing tracks, including the track name and unit price. The user can use the checkboxes to edit the contents of the playlist.
  • To render this view, you will need a select list object and a collection:
    • The select list will be used to render the checkboxes
    • The collection will hold the track objects within the playlist
  • You will need a PlaylistBaseViewModel class for displaying the playlist. The "edit existing" task will need another two view model classes:
    • 1. A view model class named PlaylistEditTracksFormViewModel to hold the data that is needed to render the HTML Form.
    • 2. A view model class named PlaylistEditTracksViewModel holds the data submitted by the user. 
  • As noted earlier, the "...Form" view model class will need a select list property (for multiple selections). It will also need another property to hold the collection of tracks that are on the current playlist. Do not forget to include the identifier in this view model class as well as the text (for display purposes).
image

Playlist Editor Home Albums Artists Media Types Tracks Playlists Edit playlist 90's Music Select tracks, and click the "Save changes" button Save changes Back to Details | Back to List All tracks "7", 46.4 minutes, $1.99 "40", composer U2, 2.6 minutes, $ 0.99 "Eine Kleine Nachtmusik" Serenade In G, K. 525: I. Allegro, composer Wolfgang Amadeus Mozart, 5.8 minutes, $0.99 #1 Zero, composer Cornell, Commerford, Morello, Wilk, 5 minutes, $0.99 #9 Dream, 4.6 minutes, $0.99 (Anesthesia) Pulling Teeth, composer Cliff Burton, 4.2 minutes, $0.99 (Da Le) Yaleo, composer Santana, 5.9 minutes, $0.99 (I Can't Help Falling In Love With You, 3.5 minutes, $0.99 (Oh) Pretty Woman, composer Bill Dees/Roy Orbison, 2.9 minutes, $0.99 (There Is) No Greater Love (Teo Licks), composer Isham Jones & Marty Symes, 2.8 minutes, $ 0.99 (We Are) The Road Crew, composer Clarke/Kilmister/Taylor, 3.2 minutes, $ 0.99 (White Man) In Hammersmith Palais, composer Joe Strummer/Mick Jones, 4 minutes, $0.99 (Wish I Could) Hideaway, composer J.C. Fogerty, 3.8 minutes, $ 0.99 ...And Found, 42.7 minutes, $1.99 ...And Justice For All, composer James Hetfield, Lars Ulrich & Kirk Hammett, 9.8 minutes, $ 0.99 ...In Translation, 43.4 minutes, $1.99 .07%, 43.1 minutes, $1.99 Just Like] Starting Over, 3.6 minutes. $0.99 Now on playlist 1477 (Da Le) Yaleo - 5.9 minutes - $0.99 (I Can't Help) Falling In Love With You - 3.5 minutes - $0.99 (White Man) In Hammersmith Palais - 4 minutes - $0.99 100% HardCore - 2.8 minutes - $0.99 14 Years - 4.4 minutes - $0.99 16 Toneladas - 3.2 minutes - $0.99 1979 - 4.4 minutes - $0.99 1 De Julho - 4.8 minutes - $0.99 2A.M.-5.6 minutes - $0.99 2 Minutes To Midnight - 5.6 minutes - $0.99 2 Minutes To Midnight - 5.6 minutes - $0.99 2 X 4-5.5 minutes - $0.99 2,000 Man - 5.2 minutes - $0.99 20 Flight Rock - 1.8 minutes - $0.99 2112 Overture - 4.5 minutes - $0.99 32 Dentes - 3.1 minutes - $0.99 A Carta - 5.8 minutes - $0.99 A Castle Full Of Rascals - 5.2 minutes - $0.99

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Here are the view model classes and mappers based on the given requirements Album view models public class AlbumBaseViewModel public int AlbumId get s... blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

International Marketing And Export Management

Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr

8th Edition

1292016922, 978-1292016924

More Books

Students explore these related Programming questions