public async Task <IActionResult> SearchService(string search) { ServiceViewModel webModel = JsonUtility.ToObject <ServiceViewModel>(search); webModel = await _service.SearchServiceAsync(webModel, _context); //Search Or Init bool flag = string.IsNullOrEmpty(webModel.SName) && string.IsNullOrEmpty(webModel.SAddress) && string.IsNullOrEmpty(webModel.SDate); var returnData = new { data = webModel.ServiceList, limit = webModel.Limit, page = flag ? webModel.Page : 1, total = webModel.Total }; return(Json(returnData)); }