List <string> GetTypes(AutocompleteTypeRequest request) { List <string> result = new List <string>(); if (request.includeBasicTypes) { result.AddRange(CSharpRenderer.BasicTypeNames.Values); result.AddRange(AditionalTypes); } if (request.includeEntities) { result.AddRange(TypeLogic.TypeToEntity.Keys.Select(a => a.Name)); } if (request.includeEmbeddedEntities) { result.AddRange(DynamicTypeLogic.AvailableEmbeddedEntities.Value.Select(a => a.Name)); } if (request.includeMList) { return(Fix(result, "MList", request.query)); } if (request.includeQueriable) { return(Fix(result, "IQueryable", request.query)); } return(result); }
public List <string> AutocompleteType([Required, FromBody] AutocompleteTypeRequest request) //Not comprehensive, just useful { var types = GetTypes(request); return(Filter(types, request.query, request.limit)); }