コード例 #1
0
        public HttpResponseMessage Edit(int id, NameValueCollection content)
        {
            //verificar
            var pl = new EditPlaylist(id, content["name"], content["desc"]);
            var p  = Rules.Edit.PlaylistTo(pl);

            //retornar resposta
            var response = new HttpResponseMessage(HttpStatusCode.SeeOther);

            response.Headers.Location = new Uri(string.Format("http://localhost:8080{0}", ResolveUri.For(p)));
            return(response);
        }
コード例 #2
0
        public ViewPlaylist PlaylistTo(EditPlaylist editPlaylist)
        {
            int      id   = editPlaylist.Id;
            Playlist p    = new Playlist(editPlaylist.Name, editPlaylist.Description);
            Playlist edit = repo.update <Playlist>(id, p);

            if (edit != null)
            {
                return(new ViewPlaylist(id, edit.Name, edit.Description, edit.Tracks));
            }
            return(null);
        }
コード例 #3
0
        private async void ExecuteEditPlaylist(object parameter)
        {
            EditPlaylist editPlaylistDialog = new EditPlaylist(this);

            await editPlaylistDialog.ShowAsync();
        }