public List <Lite <TypeEntity> > FindMainEntityType(string subString, int count) { var list = TypeLogic.TypeToEntity .Where(kvp => typeof(ICaseMainEntity).IsAssignableFrom(kvp.Key)) .Select(kvp => kvp.Value.ToLite()); return(AutocompleteUtils.Autocomplete(list, subString, count)); }
internal List <Lite <IWorkflowNodeEntity> > Autocomplete(string subString, int count, List <Lite <IWorkflowNodeEntity> > excludes) { var events = AutocompleteUtils.Autocomplete(Events.Where(a => a.Value.Type == WorkflowEventType.Finish).Select(a => a.Key), subString, count); var activities = AutocompleteUtils.Autocomplete(Activities.Keys, subString, count); var gateways = AutocompleteUtils.Autocomplete(Gateways.Keys, subString, count); return(new Sequence <Lite <IWorkflowNodeEntity> >() { events, activities, gateways } .Except(excludes.EmptyIfNull()) .OrderByDescending(a => a.ToString() !.Length) .Take(count) .ToList()); }