public string Search(IContext context) { if (!context.Ajax) { var log = new SysLogModel(context: context); var html = SearchIndexUtilities.Search(context: context); log.Finish(context: context, responseSize: html.Length); return(html); } else { var log = new SysLogModel(context: context); var json = SearchIndexUtilities.SearchJson(context: context); log.Finish(context: context, responseSize: json.Length); return(json); } }
public ActionResult Search() { if (!Libraries.Requests.Request.IsAjaxRequest(Request)) { var log = new SysLogModel(); var html = SearchIndexUtilities.Search(); ViewBag.HtmlBody = html; log.Finish(html.Length); return(View()); } else { var log = new SysLogModel(); var json = SearchIndexUtilities.SearchJson(); log.Finish(json.Length); return(Content(json)); } }
public ActionResult Search() { var context = new Context(); if (!Request.IsAjaxRequest()) { var log = new SysLogModel(context: context); var html = SearchIndexUtilities.Search(context: context); ViewBag.HtmlBody = html; log.Finish(context: context, responseSize: html.Length); return(View()); } else { var log = new SysLogModel(context: context); var json = SearchIndexUtilities.SearchJson(context: context); log.Finish(context: context, responseSize: json.Length); return(Content(json)); } }