public void DeleteUser(int id) { var user = _usersLogic.GetUser(id); if (user != null) { _usersLogic.DeleteUser(id); } }
public static void DeleteUser(Users user) { if (_usersLogic.DeleteUser(user)) { List <Blogs> ListBlogs = new List <Blogs>(); ListBlogs = BlogsPL.GetUserBlogs(user); List <Cars> ListCars = new List <Cars>(); ListCars = CarsPL.GetUserCars(user); foreach (var item in ListBlogs) { BlogsPL.DeleteBlogUser(item, user.Nickname); } foreach (var item in ListCars) { CarsPL.DeleteCar(item); } } }
public IHttpActionResult Delete(Guid id) { _data.DeleteUser(id); return(Ok("User Deleted")); }