Adding Delete ActionResult (2)

Take a look at first Delete ActionResult. The idea is same as Edit ActionResult, retrieveing the matched song id with database's id. Then, throw it into view class.

SongModel model = context.Songs.Where(some => some.Id == id).Select(some =>
                                  new SongModel()
                                  {
                                      Id = some.Id,
                                      Title = some.Title,
                                      Singer = some.Singer,
                                      Year = some.Year,
                                      Writer = some.Writer,
                                      GenreName = some.Genre.Name
                                  }).SingleOrDefault();

results matching ""

    No results matching ""