public async Task <IActionResult> PutSDriveList([FromRoute] int id, [FromBody] SDriveList sDriveList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != sDriveList.DriveId) { return(BadRequest()); } _context.Entry(sDriveList).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SDriveListExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostSDriveList([FromBody] SDriveList sDriveList) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.SDriveList.Add(sDriveList); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSDriveList", new { id = sDriveList.DriveId }, sDriveList)); }