Пример #1
0
        protected virtual ModelListClient <CM> ToClientCollection(ICollection <VM> collection)
        {
            if (collection == null)
            {
                return(null);
            }
            ModelListClient <CM> list = new ModelListClient <CM>();

            foreach (VM m in collection)
            {
                list.Add(ToClient(m));
            }
            return(list);
        }
Пример #2
0
        public ModelListClient <TopicClient> GetStickyTopics(string threadKey)
        {
            Expression <Func <ContentTopic, bool> > predicate = PredicateBuilder.True <ContentTopic>();

            if (_threadWork.TotalThreadCount > 1)
            {
                var currentThread = string.IsNullOrEmpty(threadKey) ? _threadWork.RootThread : _threadWork.GetThread(threadKey);
                predicate = predicate.And(x => x.ThreadId == currentThread.Id);
            }

            predicate = predicate.And(x => x.IsSticky && !x.IsHidden);
            var query = _topicWork.Query(predicate, "CreateTime");
            ModelListClient <TopicClient> modelList = new ModelListClient <TopicClient>();

            foreach (var topic in query)
            {
                modelList.Add(ToClient(topic, excludeProperties: new string[] { "Tags", "FirstComment", "Comments", "UploadPermission" }));
            }

            return(modelList);
        }
Пример #3
0
 public PageTopicFilterClient()
 {
     TagOptions        = new ModelListClient <TagOptionClient>();
     TagOptions.Models = new List <TagOptionClient>();
 }