/// <summary> /// 显示书架 /// </summary> /// <returns></returns> public List <Booshelfs> Query(int Uid, int Bid) { var result = booshelfs_DAL.Query().Where(b => b.BookshelfGroupId.Equals(Bid) && b.UserId.Equals(Uid)).ToList(); List <Booshelfs> li = new List <Booshelfs>(); foreach (var item in result) { List <Chapters> list = chapters_DAL.Query(item.NovelId).OrderByDescending(m => m.CreateDate).ToList(); if (list.Count != 0) { item.Time = list.FirstOrDefault().CreateDate; item.ChapterName = list.FirstOrDefault().ChapterName; li.Add(item); } } return(li); }
/// <summary> /// 前台小说显示 /// </summary> /// <returns></returns> public List <Novels> Querys() { var result = iNovels_DAL.Query(); List <Novels> li = new List <Novels>(); foreach (var item in result) { var list = iChapters_DAL.Query(item.NovelId).OrderByDescending(m => m.CreateDate).ToList(); var count = 0; foreach (var it in list) { count = count + it.WordSize; } if (list.Count != 0) { item.NewTime = list.FirstOrDefault().CreateDate; item.ChapterName = list.FirstOrDefault().ChapterName; item.Count = count; li.Add(item); } } return(li); }
/// <summary> /// 获取章节信息 /// </summary> /// <returns></returns> public List <Chapters> Query(int novelId) { var result = iChapters_DAL.Query(novelId); return(result); }