public JsonResult DropDown(string key, int?p) { if (string.IsNullOrWhiteSpace(key) || key.Length < 3) { return(null); } var result = _mapper.Map <List <DropDownViewModel> >(_dropDownService.GetBusinesses(key, (p.GetValueOrDefault(1) - 1) * 30, 30, out long totalCount)); return(Json(new DropDownModel { TotalCount = totalCount, Items = result }, JsonRequestBehavior.AllowGet)); }