示例#1
0
        public async Task <ActionResult <Test1Result> > PostTest1Result(Test1Result test1Result)
        {
            _context.Test1Results.Add(test1Result);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTest1Result", new { id = test1Result.Id }, test1Result));
        }
示例#2
0
        public async Task <IActionResult> PutTest1Result(long id, Test1Result test1Result)
        {
            if (id != test1Result.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }