public ActionResult Index(string search = "") { var codecPresets = string.IsNullOrWhiteSpace(search) ? _codecPresetRepository.GetAll() : _codecPresetRepository.Find(search); ViewBag.SearchString = search; return(View(codecPresets)); }
private void GetCodecPresetViewModels(UserAgentViewModel model, List <CodecPreset> connectedCodecPresets = null) { var codecPresets = _codecPresetRepository.GetAll(); model.CodecPresets = new List <CodecPresetListItemViewModel>(); foreach (var codecPreset in codecPresets) { model.CodecPresets.Add(new CodecPresetListItemViewModel() { Id = codecPreset.Id, Name = codecPreset.Name, Selected = connectedCodecPresets != null ? connectedCodecPresets.Any(c => c.Id == codecPreset.Id) : false }); } }