public JsonResult GetMessageList(MessageFilterModel filter) { var messageListDb = this.vkProvider.GetVkMessages(filter); var messageList = Mapper.Map <List <VkMessage>, List <MessageModel> >(messageListDb.ToList()); var model = new MessageViewModel { MessageList = messageList, TotalItemCount = messageList.Count() }; return(Json(model, JsonRequestBehavior.AllowGet)); }
private Expression <Func <VkMessage, bool> > GetFilters(MessageFilterModel filter) { return(PredicateBuilder.New <VkMessage>()); }
public IQueryable <VkMessage> GetVkMessages(MessageFilterModel filter) { var predicate = this.GetFilters(filter); return(this.vkMessRepository.Filter(predicate)); }