Exemple #1
0
        public async Task <IActionResult> PutXUserRegistartion([FromRoute] Guid id, [FromBody] XUserRegistartion varXUserRegistartion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != varXUserRegistartion.XUserRegistartionId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> PostXUserRegistartion([FromBody] XUserRegistartion varXUserRegistartion)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.XUserRegistartion.Add(varXUserRegistartion);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetXUserRegistartion", new { id = varXUserRegistartion.XUserRegistartionId }, varXUserRegistartion));
        }