示例#1
0
        public async Task <IViewComponentResult> InvokeAsync(BlogWidget model)
        {
            model.Categories = null;
            model.Tags       = null;

            return(View("/UI/Views/Components/BlogWidgetForm.cshtml", model));
        }
示例#2
0
        public IActionResult UpdateBlogWidget(BlogWidget model)
        {
            if (ModelState.IsValid)
            {
                _blogWidgetService.UpdateModel(model);
                return(Ok(model));
            }

            return(BadRequest(ModelState));
        }
示例#3
0
        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));
        }