Пример #1
0
        public void DeleteUser()
        {
            UserCrudService _userService = new UserCrudService();
            User            user         = _userService.GetUserByPhone("0123456788");

            _userService.DeleteUser(user.Id);

            User deletedUser = _userService.GetUserByPhone("0123456788");

            Assert.IsNull(deletedUser);
        }
        public ActionResult Delete(string phone)
        {
            UserModel existingUser = UserModel.FromDomain(userService.GetUserByPhone(phone));

            if (existingUser == null)
            {
                return(NotFound());
            }
            else
            {
                var id = existingUser.Id;
                userService.DeleteUser(id);
                return(NoContent());
            }
        }