public async Task <IActionResult> Puteduprog_course([FromRoute] Guid id, [FromBody] eduprog_course vareduprog_course) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != vareduprog_course.eduprog_courseId) { return(BadRequest()); } _context.Entry(vareduprog_course).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!eduprog_courseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Posteduprog_course([FromBody] eduprog_course vareduprog_course) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.eduprog_course.Add(vareduprog_course); await _context.SaveChangesAsync(); return(CreatedAtAction("Geteduprog_course", new { id = vareduprog_course.eduprog_courseId }, vareduprog_course)); }