/// <summary> /// 初始化选项列表。 /// </summary> /// <returns>返回选项列表。</returns> protected override IEnumerable <SelectListItem> Init() { var current = _stringManager.Find(Current); if (current.Parent != null) { foreach (var setting in current.Parent.Children) { yield return(new SelectListItem(setting.Value, setting.Id.ToString())); } } }
public IActionResult OnGet(int id, int pid) { if (id > 0) { Input = _stringManager.Find(id); if (Input == null) { return(NotFound()); } } else { Input = new NamedString { ParentId = pid } }; return(Page()); }
public void OnGet(int id = 0) { Current = _stringManager.Find(id); }