public IActionResult GetHospList(int page = 1, int limit = 2) { List <Hospital_Model> models = bLL.GetHospList(); var _models = models.Skip((page - 1) * limit).Take(limit); return(Ok(new { data = models, code = 0, msg = "", count = models.Count })); }
public IActionResult GetHospList(int page = 1, int limit = 2, string name = "") { List <Hospital_Model> models = hospital_BLL.GetHospList(); if (!string.IsNullOrEmpty(name)) { models = models.Where(p => p.hospitalName.Contains(name)).ToList(); } var _models = models.Skip((page - 1) * limit).Take(limit); return(Ok(new { data = models, code = 0, msg = "", count = models.Count })); }