public IHttpActionResult PostWalletBCS153114(WalletBCS153114 walletBCS153114) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.WalletBCS153114.Add(walletBCS153114); try { db.SaveChanges(); } catch (DbUpdateException) { if (WalletBCS153114Exists(walletBCS153114.WalletId)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = walletBCS153114.WalletId }, walletBCS153114)); }
public IHttpActionResult PutWalletBCS153114(int id, WalletBCS153114 walletBCS153114) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != walletBCS153114.WalletId) { return(BadRequest()); } db.Entry(walletBCS153114).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!WalletBCS153114Exists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetWalletBCS153114(int id) { WalletBCS153114 walletBCS153114 = db.WalletBCS153114.Find(id); if (walletBCS153114 == null) { return(NotFound()); } return(Ok(walletBCS153114)); }
public IHttpActionResult DeleteWalletBCS153114(int id) { WalletBCS153114 walletBCS153114 = db.WalletBCS153114.Find(id); if (walletBCS153114 == null) { return(NotFound()); } db.WalletBCS153114.Remove(walletBCS153114); db.SaveChanges(); return(Ok(walletBCS153114)); }