Created
April 6, 2020 16:19
-
-
Save yoannk/091eddf6e7ad03fb81e2e3081ac90237 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // GET: PersonnelsWS/GetPersonnels | |
| public JsonResult GetPersonnels(int page = 1, int pageSize = 10) | |
| { | |
| var personnels = db.Personnels | |
| .OrderBy(p => p.CodeAgent) | |
| .Skip((page - 1) * pageSize) | |
| .Take(pageSize) | |
| .AsEnumerable() | |
| .Select(p => new { | |
| prenom = base.ToTitleCase(p.Prenom), | |
| nom = base.ToTitleCase(p.Nom), | |
| codeAgent = p.CodeAgent, | |
| contrat = p.Contrat.Nom | |
| }); | |
| return Json(personnels, JsonRequestBehavior.AllowGet); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment