Exemple #1
0
        public async Task <List <InviteViewModel> > GetInvite()
        {
            var id   = int.Parse(User.GetName());
            var user = await _clientRepository.GetClient(id);

            var role = await _roleRepository.GetUserRole(user.IdRole);

            switch (role.Role)
            {
            case "performer":
            {
                return(await GetInvitesViewModels(await _inviteRepository.GetInvitesToPerformer(id)));
            }

            case "customer":
            {
                return(await GetInvitesViewModels(await _inviteRepository.GetCustomerInvites(id)));
            }

            default:
                throw new ArgumentException();
            }
        }