public IHttpActionResult PostShareholder_Type(Shareholder_Type shareholder_Type) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.Shareholder_Type.Add(shareholder_Type); try { db.SaveChanges(); } catch (DbUpdateException) { if (Shareholder_TypeExists(shareholder_Type.ID)) { return Conflict(); } else { throw; } } return CreatedAtRoute("DefaultApi", new { id = shareholder_Type.ID }, shareholder_Type); }
public IHttpActionResult PutShareholder_Type(string id, Shareholder_Type shareholder_Type) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != shareholder_Type.ID) { return BadRequest(); } db.Entry(shareholder_Type).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!Shareholder_TypeExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult GetShareholder_Type(string id) { Shareholder_Type shareholder_Type = db.Shareholder_Type.Find(id); if (shareholder_Type == null) { return NotFound(); } return Ok(shareholder_Type); }
public IHttpActionResult DeleteShareholder_Type(string id) { Shareholder_Type shareholder_Type = db.Shareholder_Type.Find(id); if (shareholder_Type == null) { return NotFound(); } db.Shareholder_Type.Remove(shareholder_Type); db.SaveChanges(); return Ok(shareholder_Type); }