示例#1
0
 public UserController()
 {
     _usersService = new UsersService(Context, GetPageSize());
 }
示例#2
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;
     }
 }
示例#3
0
 public QuestionsController()
 {
     _usersService = new UsersService(Context, GetPageSize());
     _questionsService = new QuestionsService(Context, GetPageSize());
 }
示例#4
0
 public ManageController()
 {
     _usersService = new UsersService(Context, 0);
 }