Пример #1
0
        private static async Task <bool> CheckGroupInviteExistsByIdentifierAsync(
            string groupInviteIdentifier,
            IGroupInviteRepository groupInviteRepository)
        {
            var groupInvite = await groupInviteRepository.GetByIdentifierAsync(groupInviteIdentifier);

            return(groupInvite != null);
        }
Пример #2
0
 public GroupInviteService(IGroupInviteRepository inviteRepository,
                           IGroupInviteCommand inviteCommand,
                           IRegistrationEmailService emailService)
 {
     _inviteRepository = inviteRepository ?? throw new ArgumentNullException(nameof(inviteRepository));
     _inviteCommand    = inviteCommand ?? throw new ArgumentNullException(nameof(inviteCommand));
     _emailService     = emailService ?? throw new ArgumentNullException(nameof(emailService));
 }
Пример #3
0
        private static async Task <string> GenerateNewGroupInviteIdentifierAsync(
            Guid groupId,
            IGroupInviteRepository groupRepository)
        {
            var newGroupInviteIdentifier = ModelHelpers.GenerateUniqueIdentifier(IdentifierConsts.GroupIdentifierLength);
            var groupInviteExistsForGroupWithIdentifier = await CheckGroupInviteExistsByIdentifierAsync(
                newGroupInviteIdentifier,
                groupRepository).ConfigureAwait(false);

            if (groupInviteExistsForGroupWithIdentifier)
            {
                return(await GenerateNewGroupInviteIdentifierAsync(
                           groupId,
                           groupRepository).ConfigureAwait(false));
            }
            else
            {
                return(newGroupInviteIdentifier);
            }
        }
 public DeleteGroupInviteCommandHandler(IGroupInviteRepository groupInviteRepository, IUnitOfWork unitOfWork)
 => (_groupInviteRepository, _unitOfWork)
Пример #5
0
 public AddGroupInviteCommandHandler(IGroupInviteRepository groupInviteRepository, IUnitOfWork unitOfWork, IGroupRepository groupRepository)
 {
     _groupInviteRepository = groupInviteRepository;
     _unitOfWork            = unitOfWork;
     _groupRepository       = groupRepository;
 }
Пример #6
0
 public GetGroupInviteQueryHandler(IGroupInviteRepository repository)
 => _repository = repository;
Пример #7
0
 public UpdateGroupInviteCommandHandler(IGroupInviteRepository grouInviteRepository, IGroupRepository groupRepository, IUnitOfWork unitOfWork)
 => (_groupInviteRepository, _groupRepository, _unitOfWork)