private static async Task <bool> CheckGroupInviteExistsByIdentifierAsync(
            string groupInviteIdentifier,
            IGroupInviteRepository groupInviteRepository)
        {
            var groupInvite = await groupInviteRepository.GetByIdentifierAsync(groupInviteIdentifier);

            return(groupInvite != null);
        }
 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));
 }
        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)
Exemple #5
0
 public AddGroupInviteCommandHandler(IGroupInviteRepository groupInviteRepository, IUnitOfWork unitOfWork, IGroupRepository groupRepository)
 {
     _groupInviteRepository = groupInviteRepository;
     _unitOfWork            = unitOfWork;
     _groupRepository       = groupRepository;
 }
Exemple #6
0
 public GetGroupInviteQueryHandler(IGroupInviteRepository repository)
 => _repository = repository;
Exemple #7
0
 public UpdateGroupInviteCommandHandler(IGroupInviteRepository grouInviteRepository, IGroupRepository groupRepository, IUnitOfWork unitOfWork)
 => (_groupInviteRepository, _groupRepository, _unitOfWork)