コード例 #1
0
        public IActionResult GetPagedList()
        {
            var pagedList = new GenericPagedList <UserModel>();

            pagedList.Items      = UserModelFaker.GetUsers();
            pagedList.PageIndex  = 0;
            pagedList.PageSize   = 10;
            pagedList.TotalCount = 3;
            pagedList.TotalPages = 1;
            return(Ok(pagedList));
        }
コード例 #2
0
        public IActionResult GetCitizenshipNumber(int id)
        {
            var result = UserModelFaker.GetUsers().FirstOrDefault(q => q.Id == id).CitizenshipNumber;

            return(Ok(result));
        }
コード例 #3
0
        public IActionResult Get(int id)
        {
            var result = UserModelFaker.GetUsers().FirstOrDefault(q => q.Id == id);

            return(Ok(result));
        }
コード例 #4
0
        public IActionResult GetListIQueryable()
        {
            var result = UserModelFaker.GetUsers().Where(q => q.Age > 2).AsQueryable();

            return(Ok(result));
        }
コード例 #5
0
        public IActionResult GetList()
        {
            var result = UserModelFaker.GetUsers();

            return(Ok(result));
        }