Beispiel #1
0
 /// <summary>
 /// 获取单条数据
 /// </summary>
 /// <returns></returns>
 public V_xy_sp_chapter Get(Expression <Func <xy_sp_chapter, bool> > predicate = null)
 {
     using (xy_sp_chapterDAL dal = new xy_sp_chapterDAL()){
         xy_sp_chapter entity = dal.Get(predicate);
         return(EntityToModel(entity));
     }
 }
Beispiel #2
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public IEnumerable <V_xy_sp_chapter> GetList(PageInfo page)
        {
            using (xy_sp_chapterDAL dal = new xy_sp_chapterDAL()){
                var list = dal.Get();

                return(list.Paging(ref page).Select(EntityToModel).ToList());
            }
        }
Beispiel #3
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable <V_xy_sp_chapter> Get()
 {
     using (xy_sp_chapterDAL dal = new xy_sp_chapterDAL()){
         List <xy_sp_chapter>   entitys = dal.Get().ToList();
         List <V_xy_sp_chapter> list    = new List <V_xy_sp_chapter>();
         foreach (xy_sp_chapter item in entitys)
         {
             list.Add(EntityToModel(item));
         }
         return(list);
     }
 }