public async Task <IHttpActionResult> PostC102575814Sale(C102575814Sale c102575814Sale) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.C102575814Sale.Add(c102575814Sale); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (C102575814SaleExists(c102575814Sale.DateRecorded)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = c102575814Sale.DateRecorded }, c102575814Sale)); }
public async Task <IHttpActionResult> PutC102575814Sale(DateTime id, C102575814Sale c102575814Sale) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != c102575814Sale.DateRecorded) { return(BadRequest()); } db.Entry(c102575814Sale).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!C102575814SaleExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetC102575814Sale(DateTime id) { C102575814Sale c102575814Sale = await db.C102575814Sale.FindAsync(id); if (c102575814Sale == null) { return(NotFound()); } return(Ok(c102575814Sale)); }
public async Task <IHttpActionResult> DeleteC102575814Sale(DateTime id) { C102575814Sale c102575814Sale = await db.C102575814Sale.FindAsync(id); if (c102575814Sale == null) { return(NotFound()); } db.C102575814Sale.Remove(c102575814Sale); await db.SaveChangesAsync(); return(Ok(c102575814Sale)); }