public async Task <IHttpActionResult> Putsalaryinfo(int id, salaryinfo salaryinfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != salaryinfo.idSalaryinfo) { return(BadRequest()); } db.Entry(salaryinfo).State = EntityState.Modified; try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!salaryinfoExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <IHttpActionResult> Getsalaryinfo(int id) { salaryinfo salaryinfo = await db.salaryinfoes.FindAsync(id); if (salaryinfo == null) { return(NotFound()); } return(Ok(salaryinfo)); }
public async Task <IHttpActionResult> Postsalaryinfo(salaryinfo salaryinfo) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.salaryinfoes.Add(salaryinfo); await db.SaveChangesAsync(); return(CreatedAtRoute("DefaultApi", new { id = salaryinfo.idSalaryinfo }, salaryinfo)); }
public async Task <IHttpActionResult> Deletesalaryinfo(int id) { salaryinfo salaryinfo = await db.salaryinfoes.FindAsync(id); if (salaryinfo == null) { return(NotFound()); } db.salaryinfoes.Remove(salaryinfo); await db.SaveChangesAsync(); return(Ok(salaryinfo)); }