public async Task <ActionResult <UserDeviceMapping> > PostUserDeviceMapping(UserDeviceMapping userDeviceMapping) { _context.UserDeviceMapping.Add(userDeviceMapping); await _context.SaveChangesAsync(); return(CreatedAtAction("GetUserDeviceMapping", new { id = userDeviceMapping.Id }, userDeviceMapping)); }
public async Task <IActionResult> PutUserDeviceMapping(int id, UserDeviceMapping userDeviceMapping) { if (id != userDeviceMapping.Id) { return(BadRequest()); } _context.Entry(userDeviceMapping).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserDeviceMappingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }