public IHttpActionResult PostInterest0136(Interest0136 interest0136) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Interest0136.Add(interest0136); try { db.SaveChanges(); } catch (DbUpdateException) { if (Interest0136Exists(interest0136.InterestCode)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = interest0136.InterestCode }, interest0136)); }
public IHttpActionResult PutInterest0136(string id, Interest0136 interest0136) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != interest0136.InterestCode) { return(BadRequest()); } db.Entry(interest0136).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Interest0136Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetInterest0136(string id) { Interest0136 interest0136 = db.Interest0136.Find(id); if (interest0136 == null) { return(NotFound()); } return(Ok(interest0136)); }
public IHttpActionResult DeleteInterest0136(string id) { Interest0136 interest0136 = db.Interest0136.Find(id); if (interest0136 == null) { return(NotFound()); } db.Interest0136.Remove(interest0136); db.SaveChanges(); return(Ok(interest0136)); }