AspNetPagingExample.Controllers.EmployeesController.Get C# (CSharp) Method

Get() public method

public Get ( int page = null, int pageSize = 10, string orderBy = nameof(Employee.Id), bool ascending = true ) : Task
page int
pageSize int
orderBy string
ascending bool
return Task
        public async Task<IHttpActionResult> Get(int? page = null, int pageSize = 10, string orderBy = nameof(Employee.Id), bool ascending = true)
        {
            if (page == null)
                return Ok(await EntityContext.Employees.ToListAsync());

            var employees = await CreatePagedResults<Employee, EmployeeModel>
                (EntityContext.Employees, page.Value, pageSize, orderBy, ascending);
            return Ok(employees);
        }
EmployeesController