Exemplo n.º 1
0
        /// <summary>
        /// Post method
        /// </summary>
        /// <param name="phoneUserId"></param>
        /// <returns>return all users deleted the specific user</returns>
        public IActionResult OnPost(int phoneUserId)
        {
            var phoneUser = repository.DeleteUser(phoneUserId);

            if (phoneUser == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            TempData["Message"] = $"{phoneUser.FirstName} is deleted";
            return(RedirectToPage("./List"));
        }
Exemplo n.º 2
0
        public async Task <bool> Delete(int id, int fileType = 0)
        {
            if (fileType != 1 && fileType != 2 && fileType != 0)
            {
                fileType = 0;
            }
            var user = await _phoneBookRepository.GetUser(id, fileType);

            if (user == null)
            {
                return(false);
            }

            var result = await _phoneBookRepository.DeleteUser(id, fileType);

            return(result);
        }
Exemplo n.º 3
0
 public void Delete(int id)
 {
     repository.DeleteUser(id);
 }