public async Task <ActionResult <PointsAsset> > PostPointsAsset(PointsAsset pointsAsset) { _context.PointsAsset.Add(pointsAsset); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPointsAsset", new { id = pointsAsset.PaId }, pointsAsset)); }
public async Task <IActionResult> PutPointsAsset(Guid id, PointsAsset pointsAsset) { if (id != pointsAsset.PaId) { return(BadRequest()); } _context.Entry(pointsAsset).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PointsAssetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }