Пример #1
0
        public async Task <IActionResult> PutApi(int id, Api api)
        {
            if (id != api.APIId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Пример #2
0
        public async Task <IActionResult> PutTestResults(int id, TestResults testResults)
        {
            if (id != testResults.TestId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }