Esempio n. 1
0
        public async Task <Unit> Handle(AddMemberToTeam request, CancellationToken cancellationToken)
        {
            try
            {
                // adding member to MS Team via Graph Client
                await _graphClient.AddMemberAsync(
                    memberId : request.MemberId,
                    teamId : request.TeamId
                    );

                // everything is ok => create event in repo that describes that member was added
                await _integrationRepository.InsertAddMemberEventAsync(
                    memberId : request.MemberId,
                    teamId : request.TeamId
                    );
            }
            catch (Exception e)
            {
                // ? maybe we need some logging on errors in such situations and there we should put it,
                // ? via injected (in future) logging service

                throw e;
            }

            // ok, return

            return(Unit.Value);
        }