public JsonResult QuickSearch(string term) { var musicStoreDB = new MusicStoreDB(); var albums = musicStoreDB.Albums.Where(a => a.Title.Contains(term)). ToList(). Select(a => new { value = a.Title }); return Json(albums,JsonRequestBehavior.AllowGet); }
private Album GetDailyDeal() { var musicStoreDb = new MusicStoreDB(); var album = musicStoreDb.Albums.OrderBy(a => a.Price).First(); album.Price *= 0.5m; return album; }
public ActionResult BestSellingArtist() { var musicStoreDB = new MusicStoreDB(); var artist = musicStoreDB.Artists.OrderBy(a=>a.Name).First(); return PartialView("_BestSellingArtist",artist); }
public ActionResult AlbumSearch(string album) { var musicStoreDB = new MusicStoreDB(); var albums = musicStoreDB.Albums.Where(a => a.Title.Contains(album)).ToList(); return PartialView("_AlbumSearch",albums); }