public IHttpActionResult PutIsmsScope(int id, IsmsScope ismsScope) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != ismsScope.ismsId) { return(BadRequest()); } db.Entry(ismsScope).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!IsmsScopeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetIsmsScope(int id) { IsmsScope ismsScope = db.IsmsScopes.Find(id); if (ismsScope == null) { return(NotFound()); } return(Ok(ismsScope)); }
public IHttpActionResult PostIsmsScope(IsmsScope ismsScope) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.IsmsScopes.Add(ismsScope); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = ismsScope.ismsId }, ismsScope)); }
public IHttpActionResult DeleteIsmsScope(int id) { IsmsScope ismsScope = db.IsmsScopes.Find(id); if (ismsScope == null) { return(NotFound()); } db.IsmsScopes.Remove(ismsScope); db.SaveChanges(); return(Ok(ismsScope)); }