Пример #1
0
 /// <summary>
 /// 获取单条数据
 /// </summary>
 /// <returns></returns>
 public V_xy_sp_spirit Get(Expression <Func <xy_sp_spirit, bool> > predicate = null)
 {
     using (xy_sp_spiritDAL dal = new xy_sp_spiritDAL()){
         xy_sp_spirit entity = dal.Get(predicate);
         return(EntityToModel(entity));
     }
 }
Пример #2
0
        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public IEnumerable <V_xy_sp_spirit> GetList(PageInfo page)
        {
            using (xy_sp_spiritDAL dal = new xy_sp_spiritDAL()){
                var list = dal.Get();

                return(list.Paging(ref page).Select(EntityToModel).ToList());
            }
        }
Пример #3
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <returns></returns>
 public IEnumerable <V_xy_sp_spirit> Get()
 {
     using (xy_sp_spiritDAL dal = new xy_sp_spiritDAL()){
         List <xy_sp_spirit>   entitys = dal.Get().ToList();
         List <V_xy_sp_spirit> list    = new List <V_xy_sp_spirit>();
         foreach (xy_sp_spirit item in entitys)
         {
             list.Add(EntityToModel(item));
         }
         return(list);
     }
 }