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); }
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); }
private async void ExecuteEditPlaylist(object parameter) { EditPlaylist editPlaylistDialog = new EditPlaylist(this); await editPlaylistDialog.ShowAsync(); }