public async Task <IActionResult> PutTaskdetails([FromRoute] int id, [FromBody] Taskdetails taskdetails) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != taskdetails.Id) { return(BadRequest()); } _context.Entry(taskdetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TaskdetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostTaskdetails([FromBody] Taskdetails taskdetails) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.tasks.Add(taskdetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTaskdetails", new { id = taskdetails.Id }, taskdetails)); }