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

            return(CreatedAtAction("Getuserinfor", new { id = userinfor.id }, userinfor));
        }
示例#2
0
        public async Task <IActionResult> Putuserinfor(long id, userinfor userinfor)
        {
            if (id != userinfor.id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }