public IHttpActionResult PostShares_Type(Shares_Type shares_Type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Shares_Type.Add(shares_Type); try { db.SaveChanges(); } catch (DbUpdateException) { if (Shares_TypeExists(shares_Type.ID)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = shares_Type.ID }, shares_Type)); }
public IHttpActionResult PutShares_Type(string id, Shares_Type shares_Type) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != shares_Type.ID) { return(BadRequest()); } db.Entry(shares_Type).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Shares_TypeExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetShares_Type(string id) { Shares_Type shares_Type = db.Shares_Type.Find(id); if (shares_Type == null) { return(NotFound()); } return(Ok(shares_Type)); }
public IHttpActionResult DeleteShares_Type(string id) { Shares_Type shares_Type = db.Shares_Type.Find(id); if (shares_Type == null) { return(NotFound()); } db.Shares_Type.Remove(shares_Type); db.SaveChanges(); return(Ok(shares_Type)); }