ForumServer.ServerController.ReportUserTotalPosts C# (CSharp) Метод

ReportUserTotalPosts() публичный Метод

public ReportUserTotalPosts ( string adminUsername, string adminPassword, string username ) : int
adminUsername string
adminPassword string
username string
Результат int
        public int ReportUserTotalPosts(string adminUsername, string adminPassword, string username)
        {
            try
            {
                log.Info("got request to report total posts of user " + username);

                if (securityManager.AuthenticateAdmin(adminUsername, adminPassword) == Result.OK)
                    return dataManager.GetAllPosts().Where(post => post.Key.Username.Equals(username)).Count();
                return -1;

            }
            catch (Exception e)
            {
                log.Error("failed to report total posts of user " + username, e);
                throw e;
            }
        }