public async Task <IHttpActionResult> PutInvestedHistory(int id, z_InvestedHistory investedHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != investedHistory.InvestedHistoryID) { return(BadRequest()); } db.Entry(investedHistory).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InvestedHistoryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
// GET: api/InvestorInvestedHistory/5 //[ResponseType(typeof(z_InvestedHistory))] public async Task <IHttpActionResult> GetInvestedHistory(int id) { z_InvestedHistory investedHistory = await db.z_InvestedHistory.FindAsync(id); if (investedHistory == null) { return(NotFound()); } return(Ok(investedHistory)); }
public async Task <IHttpActionResult> Postz_InvestedHistory(z_InvestedHistory investedHistory) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.z_InvestedHistory.Add(investedHistory); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = investedHistory.InvestedHistoryID }, investedHistory)); }
// DELETE: api/InvestorInvestedHistory/5 //[ResponseType(typeof(z_InvestedHistory))] public async Task <IHttpActionResult> DeleteInvestedHistory(int id) { z_InvestedHistory investedHistory = await db.z_InvestedHistory.FindAsync(id); if (investedHistory == null) { return(NotFound()); } db.z_InvestedHistory.Remove(investedHistory); await db.SaveChangesAsync(); return(Ok(investedHistory)); }