public async Task <IActionResult> PutPcoLicenceDetail(string id, PcoLicenceDetail pcoLicenceDetail)
        {
            if (id != pcoLicenceDetail.AppUserId)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <AppUserDto> > DeleteAppUser(string id)
        {
            var appUser = _mapper.Map <AppUserDto>(await _appUserRepository.FindAsync(id));

            //var appUser = await _context.AppUsers.FindAsync(id);
            if (appUser == null)
            {
                return(NotFound());
            }
            await _appUserRepository.RemoveAsync(_mapper.Map <AppUser>(appUser));

            //_context.AppUsers.Remove(appUser);
            await _context.SaveChangesAsync();

            return(appUser);
        }