public IHttpActionResult PutView_Bank_Accounts(int id, View_Bank_Accounts view_Bank_Accounts) { if (!ModelState.IsValid) { return BadRequest(ModelState); } if (id != view_Bank_Accounts.Id) { return BadRequest(); } db.Entry(view_Bank_Accounts).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!View_Bank_AccountsExists(id)) { return NotFound(); } else { throw; } } return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostView_Bank_Accounts(View_Bank_Accounts view_Bank_Accounts) { if (!ModelState.IsValid) { return BadRequest(ModelState); } db.View_Bank_Accounts.Add(view_Bank_Accounts); db.SaveChanges(); return CreatedAtRoute("DefaultApi", new { id = view_Bank_Accounts.Id }, view_Bank_Accounts); }