public JsonResult SearchAuto([FromServices] IReferenceSearchService service, [FromQuery] string prefix)
        {
            var references = service.Search(prefix, new RequestParams {
                Limit = 12
            });

            return(Json(references));
        }
Пример #2
0
        public async Task <JsonResult> Search([FromServices] IReferenceSearchService service, [FromQuery] string prefix)
        {
            var results = service.Search(prefix, new RequestParams {
                Limit = 12
            });

            return(Json(new
            {
                Success = true,
                Content = await this.RenderViewAsync("Header/_SearchResultsPartial", FormViewModel(results), true)
            }));
        }