public async Task <IHttpActionResult> PostC102575814Customer(C102575814Customer c102575814Customer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.C102575814Customer.Add(c102575814Customer); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (C102575814CustomerExists(c102575814Customer.CustNo_)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = c102575814Customer.CustNo_ }, c102575814Customer)); }
public async Task <IHttpActionResult> PutC102575814Customer(int id, C102575814Customer c102575814Customer) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != c102575814Customer.CustNo_) { return(BadRequest()); } db.Entry(c102575814Customer).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!C102575814CustomerExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetC102575814Customer(int id) { C102575814Customer c102575814Customer = await db.C102575814Customer.FindAsync(id); if (c102575814Customer == null) { return(NotFound()); } return(Ok(c102575814Customer)); }
public async Task <IHttpActionResult> DeleteC102575814Customer(int id) { C102575814Customer c102575814Customer = await db.C102575814Customer.FindAsync(id); if (c102575814Customer == null) { return(NotFound()); } db.C102575814Customer.Remove(c102575814Customer); await db.SaveChangesAsync(); return(Ok(c102575814Customer)); }