public async Task <IActionResult> Create(CategoryDto categoryDto) { //burası da submit edileceği zaman çalışıcak yer burasıdır. //await _categoryService.AddAsync(_mapper.Map<Category>(categoryDto)); await _categoryApiService.AddAsync(categoryDto); return(RedirectToAction("Index")); }
public async Task <IActionResult> Create(CategoryDto categoryDto) { await _categoryApiService.AddAsync(categoryDto); //await _categoryService.AddAsync(_mapper.Map<Category>(categoryDto)); //return View(_mapper.Map<CategoryDto>(newCategory)); return(RedirectToAction("Index")); }
public async Task <IActionResult> Create(CategoryDto categoryDto) { if (ModelState.IsValid) { await _categoryApiService.AddAsync(categoryDto); return(RedirectToAction("Index")); } return(View(categoryDto)); }
public async Task <IActionResult> Create(CategoryModel categoryModel) { await _categoryApiService.AddAsync(categoryModel); return(RedirectToAction("Index")); }
public async Task <IActionResult> Create([FromForm] CategoryDto categoryDto) { var category = await _categoryApiService.AddAsync(categoryDto); return(RedirectToAction("Index")); }