public async Task <IHttpActionResult> PutCustomLargeDataEntity(int id, CustomLargeDataEntity customLargeDataEntity) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customLargeDataEntity.Id) { return(BadRequest()); } db.Entry(customLargeDataEntity).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomLargeDataEntityExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> GetCustomLargeDataEntity(int id) { CustomLargeDataEntity customLargeDataEntity = await db.CustomLargeDataEntities.FindAsync(id); if (customLargeDataEntity == null) { return(NotFound()); } return(Ok(customLargeDataEntity)); }
public async Task <IHttpActionResult> PostCustomLargeDataEntity(CustomLargeDataEntity customLargeDataEntity) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.CustomLargeDataEntities.Add(customLargeDataEntity); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = customLargeDataEntity.Id }, customLargeDataEntity)); }
public async Task <IHttpActionResult> DeleteCustomLargeDataEntity(int id) { CustomLargeDataEntity customLargeDataEntity = await db.CustomLargeDataEntities.FindAsync(id); if (customLargeDataEntity == null) { return(NotFound()); } db.CustomLargeDataEntities.Remove(customLargeDataEntity); await db.SaveChangesAsync(); return(Ok(customLargeDataEntity)); }