public PartialViewResult GetAutocompleteResults(string query) { dynamic data = AutocompleteAlgorithms.ParseQuery(query); List<AutocompleteInfo> tests = new TestsRepository().GetAutocompleteItems(data.space, data.test); List<AutocompleteInfo> spaces = new SpacesRepository().GetAutocompleteItems(data.space, data.test); return PartialView(spaces.Union(tests).ToList()); }
public static List<SelectListItem> GetSpacesList() { SpacesRepository repository = new SpacesRepository(); var list = repository.GetSpaces().Select(x => new SelectListItem() { Text = x.Shortcut, Value = x.Id.ToString(), Selected = false }).ToList(); list.Insert(0, new SelectListItem() { Text = "Спэйс", Value = "0", Selected = true }); return list; }