コード例 #1
0
        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);
        }
コード例 #2
0
 // 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);
 }
コード例 #3
0
 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);
 }