Esempio n. 1
0
        //[AllowAnonymous]
        public async Task <IActionResult> Putinvg_grp([FromRoute] Guid id, [FromBody] invg_grp varinvg_grp)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != varinvg_grp.invg_grpId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Esempio n. 2
0
        //[AllowAnonymous]
        public async Task <IActionResult> Postinvg_grp([FromBody] invg_grp varinvg_grp)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.invg_grp.Add(varinvg_grp);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("Getinvg_grp", new { id = varinvg_grp.invg_grpId }, varinvg_grp));
        }