public Task <IViewComponentResult> InvokeAsync(SelectDropDownViewModel model) { if (model == null) { model = new SelectDropDownViewModel(); } return(Task.FromResult((IViewComponentResult)View(model))); }
public override async Task ComposeModelAsync(Topic question, IUpdateModel updater) { var model = new SelectDropDownViewModel() { SelectedValue = GetIsPrivate().ToString() }; await updater.TryUpdateModelAsync(model); if (updater.ModelState.IsValid) { question.IsPrivate = GetIsPrivate(); } }