Open jthompsonnait opened 1 year ago
This comment outlines the actions that can happen on the forms. Actions are in response to the user interacting with the form, pressing buttons or controls.
PRG Post Redirect Get (Query)
The data models are the C# classes that we be coded in the folder (ViewModels) that holds the data classes in our solution. These classes represent the query class models and the command class models (CQRS - Command and Query Responsibility Segregation Pattern)
public class TrackSelectionView
{
public int TrackId { get; set; }
public string SongName { get; set; }
public string AlbumTitle { get; set; }
public string ArtistName { get; set; }
public int Milliseconds { get; set; }
public decimal Price { get; set; }
public string Length
{
get { return $"{(int)Milliseconds / 60 / 1000}:{Milliseconds / 1000 % 60}"; }
}
}
public class PlaylistTrackView
{
public int TrackId { get; set; }
public bool Remove { get; set; }
public int TrackNumber { get; set; }
public string SongName { get; set; }
public int Milliseconds { get; set; }
public string Length
{
get { return $"{(int)Milliseconds / 60 / 1000}:{Milliseconds / 1000 % 60}"; }
}
public int NewTrackNumber { get; set; }
}
No model class, individual parameters public string AddTracks(string userName, string playlistName, int trackId)
No model class, individual parameters public string RemoveTracks(int playlistId, list<int> trackIDs)
public class MoveTrackCommand
{
public int TrackId {get; set;}
public int TrackNumber {get; set;}
}
This comment will describe the various methods that will be used for Commands (CRQS) that alter the database. Queries are read-only and require, on average, no complex processing. You may in another comment, outline your query methods. However, commands require business rules, data validation and manipulations of one or more tables and/or records. Therefore, the processing of commands could require extensive logic to be outlined.
Include the method signature and a bullet list of processing (pseido-code)
list<PlaylistTrackView> PlaylistTrackServices_FetchPlaylist(string userName, string playlistName)
check if the playlist name exists
list<TrackSelectionView> PlaylistTrackServices_FetchArtistOrAlbumTracks(string searchType, string searchValue)
check if the searchValue exists
check if the incoming data is complete (all parameter exists)
check that track exists
check to see if playlist exists
This task list area will be completed once the implementation plan has been outlined. This area is where one creates the task list associated with the milestone.