Exemple #1
0
        public async Task <Guid> CreateInvite(Guid id, EmailRequestModel model)
        {
            try
            {
                var employee = await _employeeRepository.GetById(id);

                if (employee == null)
                {
                    throw new Exception("Employee is null");
                }

                var invite = new Invite(model.email, id);

                _inviteRepository.Add(invite);
                await _inviteRepository.SaveChanges();

                return(invite.Id);
            }
            catch (Exception e)
            {
                throw e;
            }
        }