示例#1
0
        public async Task <ActionResult <RickMory> > PostRickMory(RickMory rickMory)
        {
            _context.RickMory.Add(rickMory);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetRickMory", new { id = rickMory.id }, rickMory));
        }
示例#2
0
        public async Task <IActionResult> PutRickMory(Guid id, RickMory rickMory)
        {
            if (id != rickMory.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }