public void UpdateTag(AjaxEditTagViewModel viewModel) { if (Request.IsAjaxRequest()) { _topicTagService.UpdateTagNames(viewModel.NewName, viewModel.OldName); try { Context.SaveChanges(); } catch (Exception ex) { Context.RollBack(); LoggingService.Error(ex); } } }
public void UpdateTag(AjaxEditTagViewModel viewModel) { if (Request.IsAjaxRequest()) { using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { _topicTagService.UpdateTagNames(viewModel.NewName, viewModel.OldName); try { unitOfWork.Commit(); } catch (Exception ex) { unitOfWork.Rollback(); LoggingService.Error(ex); } } } }