public HttpResponseMessage GetTracks(string q = "") { List <TrackViewModel> track = new List <TrackViewModel>(); track = _track.SearchTrack("", "", "", q); var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(JsonConvert.SerializeObject(track), System.Text.Encoding.UTF8, "application/json"); return(response); }
// GET: Track public ActionResult Index(string TrackName = "", string AlbumName = "", string ArtistName = "", string URL = "", int Page = 1) { using (var context = new Uow(this.context)) { var repos = new RepositoryTrack(context); List <TrackViewModel> items; items = repos.SearchTrack(TrackName, AlbumName, ArtistName, URL); ViewBag.TrackName = TrackName; ViewBag.AlbumName = AlbumName; ViewBag.ArtistName = ArtistName; ViewBag.URL = URL; ViewBag.Page = Page; return(View(items.ToPagedList(Page, 50))); } }