private static void GetThanksPositionsInTopics() { var featuresContext = (FeaturesContext)FeaturesDBConnection.GetInstance().GetContext; var topicIds = buhOnlineContext.yaf_Topic.Select(p => p.TopicID).ToArray(); var thankDict = FileProcessing.MessageIdAndIsThankPost.ToDictionary(); foreach (var topicId in topicIds) { var messages = DBCache.GetTopicMessages(topicId, buhOnlineContext); var posts = messages.Where(m => thankDict[m.MessageID] == 1).Select(m => m.Position); ThanksPositionsInTopics.Add(topicId, new HashSet <int>(posts)); } }
private static int ThreadLength(yaf_Message item) { return(DBCache.GetTopicMessages(item.TopicID, buhOnlineContext).Count()); }
private static double QuotientPostLengthToAvarageInTopic(yaf_Message item) { var avgLen = DBCache.GetTopicMessages(item.TopicID, buhOnlineContext).Average(p => p.Message.Length); return(item.GetText().Length / avgLen); }
private static yaf_Message GetNthPost(int topicId, int n) { return(DBCache.GetTopicMessages(topicId, buhOnlineContext).First(p => p.Position == n)); }