public bool Remove(int id) { var users = this.GetAll().ToList(); User user = users.FirstOrDefault(u => u.Id == id); if (user == null) { return(false); } users.Remove(user); UserAwardDao.RemoveUserAwards(user.Id); ImageDao.RemoveUserImage(user.Id, ImageFolder); var usersAsTxt = users.Select(UserAsTxt); File.WriteAllLines(UsersFilePath, usersAsTxt); return(true); }
public bool RemoveImage(int id) { return(ImageDao.RemoveUserImage(id, ImageFolder)); }