public IHttpActionResult PostGenre(Genre genre) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _dALGenre.AddGenre(genre); return(CreatedAtRoute("DefaultApi", new { id = genre.Id }, genre)); }
private void AddZanrExecute() { try { if (!string.IsNullOrEmpty(Genre.Name)) { Genre newGenre = new Genre { Name = Genre.Name, Deleted = false }; _dALHelper.AddGenre(newGenre); actor_window.Close(); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }