예제 #1
0
        public JsonResult TypeAhead(string q)
        {
            if (q?.Length < 2)
            {
                return(Json(JsonEnvelope.Error("Waiting for input...")));
            }

            var data = _todoService.AssigneeSearch(q);

            if (data.Length > 0)
            {
                return(Json(JsonEnvelope.Success(data)));
            }

            return(Json(JsonEnvelope.Error("No results found")));
        }