Beispiel #1
0
        public async Task <IActionResult> PutAuthenticationDetail(int id, AuthenticationDetail authenticationDetail)
        {
            if (id != authenticationDetail.UserId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <AuthenticationDetail> > PostAuthenticationDetail(AuthenticationDetail authenticationDetail)
        {
            _context.AuthenticationDetails.Add(authenticationDetail);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetAuthenticationDetail", new { id = authenticationDetail.UserId }, authenticationDetail));
        }