public IHttpActionResult PutDiasAsesor(int id, DiasAsesor diasAsesor) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != diasAsesor.Id) { return(BadRequest()); } db.Entry(diasAsesor).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!DiasAsesorExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public IHttpActionResult GetDiasAsesor(int id) { DiasAsesor diasAsesor = db.DiasAsesor.Find(id); if (diasAsesor == null) { return(NotFound()); } return(Ok(diasAsesor)); }
public IHttpActionResult PostDiasAsesor(DiasAsesor diasAsesor) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.DiasAsesor.Add(diasAsesor); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = diasAsesor.Id }, diasAsesor)); }
public IHttpActionResult DeleteDiasAsesor(int id) { DiasAsesor diasAsesor = db.DiasAsesor.Find(id); if (diasAsesor == null) { return(NotFound()); } db.DiasAsesor.Remove(diasAsesor); db.SaveChanges(); return(Ok(diasAsesor)); }