public async Task <IActionResult> Insert(NewsGroupInsertViewModel model) { var result = await _newsGroupRepository.AddAsync(model); TempData.AddResult(result); return(Redirect(IndexUrlWithQueryString)); }
public async Task <IActionResult> Insert(NewsGroupInsertViewModel model) { var result = await _newsGroupRepository.AddAsync(model); TempData.AddResult(result); return(RedirectToAction("Index")); }
/// <summary> /// ثبت یک آیتم در جدول مورد نظر /// </summary> /// <param name="model">مدلی که از سمت کلاینت در حال پاس دادن آن هستیم</param> /// <returns></returns> public async Task <SweetAlertExtenstion> AddAsync(NewsGroupInsertViewModel model) { try { var entity = Mapper.Map <NewsGroup>(model); await AddAsync(entity); return(SweetAlertExtenstion.Ok()); } catch { return(SweetAlertExtenstion.Error()); } }