public async Task <IViewComponentResult> InvokeAsync(BlogWidget model) { model.Categories = null; model.Tags = null; return(View("/UI/Views/Components/BlogWidgetForm.cshtml", model)); }
public IActionResult UpdateBlogWidget(BlogWidget model) { if (ModelState.IsValid) { _blogWidgetService.UpdateModel(model); return(Ok(model)); } return(BadRequest(ModelState)); }
public IActionResult DeleteBlogWidget(BlogWidget model) { if (model.Id != null) { _blogWidgetService.DeleteModel(model.Id); return(Ok()); } return(BadRequest()); }
public async Task <IViewComponentResult> InvokeAsync(BlogWidget model) { var userContext = _userContextAccessor.GetContext(); var viewModel = new BlogWidgetCategoryFormViewModel { WidgetId = model.Id, UserId = userContext.UserId }; return(View("/UI/Views/Components/BlogWidgetCategoryBase.cshtml", viewModel)); }