/// <summary> /// 获取单条数据 /// </summary> /// <returns></returns> public V_xy_sp_equipment Get(Expression <Func <xy_sp_equipment, bool> > predicate = null) { using (xy_sp_equipmentDAL dal = new xy_sp_equipmentDAL()){ xy_sp_equipment entity = dal.Get(predicate); return(EntityToModel(entity)); } }
/// <summary> /// 获取分页数据 /// </summary> /// <param name="page"></param> /// <returns></returns> public IEnumerable <V_xy_sp_equipment> GetList(PageInfo page) { using (xy_sp_equipmentDAL dal = new xy_sp_equipmentDAL()){ var list = dal.Get(); return(list.Paging(ref page).Select(EntityToModel).ToList()); } }
/// <summary> /// 获取列表 /// </summary> /// <returns></returns> public IEnumerable <V_xy_sp_equipment> Get() { using (xy_sp_equipmentDAL dal = new xy_sp_equipmentDAL()){ List <xy_sp_equipment> entitys = dal.Get().ToList(); List <V_xy_sp_equipment> list = new List <V_xy_sp_equipment>(); foreach (xy_sp_equipment item in entitys) { list.Add(EntityToModel(item)); } return(list); } }