示例#1
0
        // GET: Third
        public ActionResult Index()
        {
            using (CyfDBContext context = new CyfDBContext())
            {
                var use = context.employees.ToList();
            }
            //CyfDBContext context= new CyfDBContext();
            //IUserService iuser = new UserService(context);
            //var user = iuser.Find<employee>(1);
            var user = _iUserService.Find <Employee>(1);

            return(View());
        }
        public List <User> QueryListByEF(int tableNum, int pageIndex, int pageSize)
        {
            CyfDBContext context = new CyfDBContext();
            IUserService iuser   = new UserService(context);
            //var user = iuser.Find<Employee>(1);


            IUserService userService = new UserService(new CyfDBContext());
            Expression <Func <Employee, int> > funcOrderby = c => c.id;
            //var users =  userService.Find<Employee>(1);
            var dataList = userService.QueryPage(null, pageSize, pageIndex, funcOrderby);

            return(dataList.DataList.Trans());
        }