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