Beispiel #1
0
        public async Task <UserDetailDto> DeleteById(int Id)
        {
            var modelToDelete = await _userDetailRepository.FindByCondition(x => x.Id == Id);

            if (!modelToDelete.Any())
            {
                throw new ApiException("No se pudo Eliminar el usuario ", HttpStatusCode.NotFound);
            }
            _userDetailRepository.Delete(modelToDelete.FirstOrDefault());
            return(_mapper.Map <UserDetailDto>(modelToDelete.FirstOrDefault()));
        }
        public async Task <IActionResult> Delete(string name)
        {
            var gameFromDb = await _userDetailRepository.GetUser(name);

            if (gameFromDb == null)
            {
                return(new NotFoundResult());
            }

            await _userDetailRepository.Delete(name);

            return(new OkResult());
        }
Beispiel #3
0
        public void RemoveUserDetails(int Id)
        {
            var UserDetails = UserDetailsRepository.GetById(Id);

            UserDetailsRepository.Delete(UserDetails);
        }