public async Task <IActionResult> Edit(int id) { ViewData["Active"] = "category"; var updatedCategory = await _categoryApiService.GetByIdAsync(id); if (updatedCategory != null) { CategoryUpdateModel categoryUpdateModel = new CategoryUpdateModel { Id = updatedCategory.Id, Name = updatedCategory.Name }; return(View(categoryUpdateModel)); } return(NotFound()); }
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { var category = await _categoryApiService.GetByIdAsync(CategoryId); var htmlContent = $"{category.Name}"; output.Content.SetContent(htmlContent); }
public async Task <IActionResult> Update(int id) { var categoryList = await _categoryApiService.GetByIdAsync(id); return(View(new CategoryUpdateModel { Id = categoryList.Id, Name = categoryList.Name })); }
public async Task <IActionResult> Update(int id) { TempData["active"] = "category"; var category = await _categoryService.GetByIdAsync(id); return(View(new CategoryUpdateModel { Id = category.Id, Name = category.Name })); }
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { if (CategoryId.HasValue) { var category = await _categoryApiService.GetByIdAsync(CategoryId.Value); string html = $"<div class='border border-info p-3 mb-2'>{category.Name} blogs are listed." + $"<a class='float-right' href='Home'>Remove Filter</a></div>"; output.Content.SetHtmlContent(html); } }
public async Task <IActionResult> Update(int id) { var result = await _categoryApiService.GetByIdAsync(id); CategoryUpdateModel model = new CategoryUpdateModel { Id = result.Id, Name = result.Name }; return(View(model)); }
public IViewComponentResult Invoke(int categoryId) { return(View(_categoryApiService.GetByIdAsync(categoryId).Result)); }
public IViewComponentResult Invoke(int categoryId) {//Asenkronik methodu kullanamıcaz oyüzden resultunu alıcaz. return(View(_categoryApiService.GetByIdAsync(categoryId).Result)); }