public ActionResult Create(PlaylistModel model) { if (ModelState.IsValid) { var playlist = PlaylistFactory.CreatePlaylist(model.PlaylistName, model.Comments); _playlistRepository.AddPlaylist(playlist); return Redirect("Index"); } Response.StatusCode = (int)HttpStatusCode.NotAcceptable; return PartialView(model); }
// GET: MediaFile/Details/5 public ActionResult AddToPlaylist(long id) { var rez = _playlistRepository.GetAllPlaylists(); var modellist = new List<PlaylistModel>(); foreach (var item in rez) { var model = new PlaylistModel(); model.PlaylistToModel(item); modellist.Add(model); } return View(modellist); }
public ViewResult Index() { var rez = _playlistRepository.GetAllPlaylists(); var modellist = new List<PlaylistModel>(); foreach(var item in rez) { var model = new PlaylistModel(); model.PlaylistToModel(item); modellist.Add(model); } return View(modellist); }