예제 #1
0
        public async Task <IActionResult> PutSpirometerTestResult(int id, SpirometerTestResult spirometerTestResult)
        {
            if (id != spirometerTestResult.SpirometerTestResultId)
            {
                return(BadRequest());
            }

            _context.Entry(spirometerTestResult).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SpirometerTestResultExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
예제 #2
0
        public async Task <ActionResult <SpirometerTestResult> > PostSpirometerTestResult(SpirometerTestResult spirometerTestResult)
        {
            _context.SpirometerTestResults.Add(spirometerTestResult);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetSpirometerTestResult", new { id = spirometerTestResult.SpirometerTestResultId }, spirometerTestResult));
        }