Exemple #1
0
 public IHttpActionResult Put(int?id, Mark mark)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     if (id == null || id != mark.Id)
     {
         return(BadRequest());
     }
     if (!MarkExists((int)id))
     {
         return(NotFound());
     }
     _repo.MarkAsModified(mark);
     _repo.SaveChanges();
     return(Ok(mark));
 }