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); }
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); }
public PageTopicFilterClient() { TagOptions = new ModelListClient <TagOptionClient>(); TagOptions.Models = new List <TagOptionClient>(); }