Exemplo n.º 1
0
        public IHttpActionResult PostGenre(Genre genre)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _dALGenre.AddGenre(genre);

            return(CreatedAtRoute("DefaultApi", new { id = genre.Id }, genre));
        }
Exemplo n.º 2
0
 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());
     }
 }