public void UpdateResourceKey(AjaxEditLanguageKeyViewModel viewModel) { if (Request.IsAjaxRequest()) { try { LocalizationService.UpdateResourceKey(viewModel.ResourceKeyId, viewModel.NewName); Context.SaveChanges(); } catch (Exception ex) { Context.RollBack(); LoggingService.Error(ex); } } }
public void UpdateResourceKey(AjaxEditLanguageKeyViewModel viewModel) { if (Request.IsAjaxRequest()) { using (var unitOfWork = UnitOfWorkManager.NewUnitOfWork()) { try { LocalizationService.UpdateResourceKey(viewModel.ResourceKeyId, viewModel.NewName); unitOfWork.Commit(); } catch (Exception ex) { unitOfWork.Rollback(); LoggingService.Error(ex); } } } }