ValuesController.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using CasinosManager.Api.Domain;
  2. using CasinosManager.Api.Dto;
  3. using CasinosManager.Api.Service;
  4. using Microsoft.AspNetCore.Mvc;
  5. using System.Linq;
  6. namespace CasinosManager.Api.Controllers
  7. {
  8. [Route("api/[controller]")]
  9. [ApiController]
  10. public class ValuesController : ControllerBase
  11. {
  12. [HttpGet()]
  13. public ActionResult<PageListOutput<Student>> Get(int page, int pageSize)
  14. {
  15. PageListOutput<Student> output = new PageListOutput<Student>();
  16. MockDataService service = new MockDataService();
  17. int skip = (page - 1) * pageSize;
  18. output.Total = service.GetStudents().Count();
  19. output.Data = service.GetStudents().Skip(skip).Take(pageSize).ToList();
  20. return output;
  21. }
  22. // PUT api/values/5
  23. [HttpPut("{id}")]
  24. public void Put(int id, [FromBody] string value)
  25. {
  26. }
  27. // DELETE api/values/5
  28. [HttpDelete("{id}")]
  29. public void Delete(int id)
  30. {
  31. }
  32. }
  33. }