示例#1
0
 public bool AskAllFollowers(string content)
 {
     var usersService = new UsersService(_context, _pageSize);
     var followers = usersService.GetFollowers(usersService.GetCurrentUserName());
     var currentUser = usersService.GetCurrentUser();
     var question = InitializeQuestion(content, currentUser);
     foreach (var follower in followers)
     {
         AddQuestionDetailToContext(currentUser, follower, question);
     }
     try
     {
         _context.SaveChanges();
         return true;
     }
     catch (Exception e)
     {
         return false;
     }
 }