public WarmUpController(VBDbContext db, VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager)
 {
     this.db              = db;
     this.threadManager   = threadManager;
     this.sessionManager  = sessionManager;
     this.settingsManager = settingsManager;
     this.forumManager    = forumManager;
     this.userManager     = userManager;
 }
Ejemplo n.º 2
0
        static void WarmUpManagers(VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager, VBThread thread, VBUser user, VBSession session)
        {
            var managerThread = threadManager.GetThreadAsync(thread.Id, writeable: true).Result;
            var replys        = threadManager.GetReplysAsync(thread.Id, start: 0, count: 1).Result;
            var settings      = settingsManager.GetCommonSettings();

            if (session != null)
            {
                // Do not update last activity since we're not in a http context => No request path avaliable
                var managerSession = sessionManager.GetAsync(session.SessionHash, updateLastActivity: false).Result;
            }

            if (user != null)
            {
                var forum = forumManager.GetCategoriesWhereUserCanAsync(user.UserGroup).Result;
                var randomUserFromManager = userManager.GetUserAsync(user.Id).Result;
            }
        }
Ejemplo n.º 3
0
        public static void WarmUpServices(VBDbContext db, VBThreadManager threadManager, VBSessionManager sessionManager, VBSettingsManager settingsManager, VBForumManager forumManager, VBUserManager userManager)
        {
            var attachment   = db.Attachments.FirstOrDefault();
            var customAvatar = db.CustomAvatars.FirstOrDefault();
            var forumPerm    = db.ForumPermissions.FirstOrDefault();
            var forum        = db.Forums.FirstOrDefault();
            var message      = db.Messages.FirstOrDefault();
            var messageText  = db.MessagesText.FirstOrDefault();
            var poll         = db.Polls.FirstOrDefault();
            var post         = db.Posts.FirstOrDefault();
            var thanks       = db.PostThanks.FirstOrDefault();
            var session      = db.Sessions.FirstOrDefault();
            var setting      = db.Settings.FirstOrDefault();
            var threadRead   = db.ThreadReads.FirstOrDefault();
            var thread       = db.Threads.FirstOrDefault();
            var group        = db.UserGroups.FirstOrDefault();
            var user         = db.Users.Include(u => u.UserGroup)
                               .FirstOrDefault();

            WarmUpManagers(threadManager, sessionManager, settingsManager, forumManager, userManager, thread, user, session);
        }
Ejemplo n.º 4
0
 public UserController(VBUserManager userManager, VBSessionManager sessionManager)
 {
     this.userManager    = userManager;
     this.sessionManager = sessionManager;
 }
Ejemplo n.º 5
0
 public ThreadController(VBThreadManager threadManager, VBUserManager userManager)
 {
     this.threadManager = threadManager;
     this.userManager   = userManager;
 }