public async Task <ActionResult <ScheduleAsset> > PostAsset(ScheduleAsset scheduleAsset) { _context.ScheduleAsset.Add(scheduleAsset); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAsset", new { id = scheduleAsset.ScheduleAssetID }, scheduleAsset)); }
public async Task <IActionResult> PutAsset(int id, ScheduleAsset scheduleAsset) { if (id != scheduleAsset.ScheduleAssetID) { return(BadRequest()); } _context.Entry(scheduleAsset).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ScheduleAssetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }