Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 private Album GetDailyDeal() {
     var musicStoreDb = new MusicStoreDB();
     var album = musicStoreDb.Albums.OrderBy(a => a.Price).First();
     album.Price *= 0.5m;
     return album;
 }
Esempio n. 3
0
 public ActionResult BestSellingArtist() {
     var musicStoreDB = new MusicStoreDB();
     var artist = musicStoreDB.Artists.OrderBy(a=>a.Name).First();
     return PartialView("_BestSellingArtist",artist); 
 }
Esempio n. 4
0
 public ActionResult AlbumSearch(string album) {
     var musicStoreDB = new MusicStoreDB();
     var albums = musicStoreDB.Albums.Where(a => a.Title.Contains(album)).ToList();
     return PartialView("_AlbumSearch",albums);
 }