Example #1
0
        private void NotifyUser(MoveTenantsToAnotherEditionJobArgs args)
        {
            using (var uow = _unitOfWorkManager.Begin())
            {
                var sourceEdition = AsyncHelper.RunSync(() => _editionManager.GetByIdAsync(args.SourceEditionId));
                var targetEdition = AsyncHelper.RunSync(() => _editionManager.GetByIdAsync(args.TargetEditionId));

                AsyncHelper.RunSync(() =>
                                    _appNotifier.TenantsMovedToEdition(args.User, sourceEdition.DisplayName, targetEdition.DisplayName)
                                    );

                uow.Complete();
            }
        }
        private async Task NotifyUserAsync(MoveTenantsToAnotherEditionJobArgs args)
        {
            using (var uow = _unitOfWorkManager.Begin())
            {
                var sourceEdition = await _editionManager.GetByIdAsync(args.SourceEditionId);

                var targetEdition = await _editionManager.GetByIdAsync(args.TargetEditionId);

                await _appNotifier.TenantsMovedToEdition(
                    args.User,
                    sourceEdition.DisplayName,
                    targetEdition.DisplayName
                    );

                await uow.CompleteAsync();
            }
        }