Exemplo n.º 1
0
        public async Task <Tuple <IList <UserAccountLoginLog>, int> > GetLoginLogByUserId(Guid userId, int skipCount, int pageSize)
        {
            var total = await ContentAccessor.Count <UserAccountLoginLog>(x => x.UserAccountEntryId == userId);

            var contentList = await ContentAccessor.ListAsync <UserAccountLoginLog>(x => x.UserAccountEntryId == userId, skipCount, pageSize);

            return(Tuple.Create(contentList, total));
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="Id"></param>
 /// <param name="skipCount"></param>
 /// <param name="pageSize"></param>
 /// <returns>文章内容, 评论总数</returns>
 public async Task <Tuple <ContentEntry, int> > GetContentWityCommentById(Guid Id, int skipCount = 0, int pageSize = 20)
 {
     return(await ApiMessage.WrapData(async() =>
     {
         var contentEnry = await ContentAccessor.OneAsync <ContentEntry>(x => x.Id == Id, "MediaResource");
         var totalNum = await ContentAccessor.Count <Comment>(x => x.ContentEntryId == Id);
         return Tuple.Create(contentEnry, totalNum);
     }));
 }
Exemplo n.º 3
0
        public async Task <Tuple <IList <Categories>, int> > GetCategoryByTagName(string tagName, int pageSkip, int pageSize)
        {
            var categoryList = await ContentAccessor.ListOrderByDescendingAsync <Categories>(x => x.Status != ContentStatus.Close &&
                                                                                             x.ContentList != null &&
                                                                                             x.ContentList.Count > 0 &&
                                                                                             x.Tags.Any(c => c.Name == tagName)
                                                                                             , pageSkip, pageSize, "MediaResource");

            await ResetCategoryCoverImg(categoryList);

            var count = await ContentAccessor.Count <Categories>(x => x.Status != ContentStatus.Close &&
                                                                 x.ContentList != null &&
                                                                 x.ContentList.Count > 0 &&
                                                                 x.Tags.Any(c => c.Name == tagName));

            return(Tuple.Create(categoryList, count));
        }