Beispiel #1
0
        public ActionResult Index(string search = "")
        {
            var codecPresets = string.IsNullOrWhiteSpace(search) ? _codecPresetRepository.GetAll() : _codecPresetRepository.Find(search);

            ViewBag.SearchString = search;
            return(View(codecPresets));
        }
Beispiel #2
0
        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
                });
            }
        }