public async Task AddInviteAsync(string senderId, string invitedId, int eventId) { var result = await _userEventRepository.AddInviteAsync(new EventInvite() { SenderId = senderId, InvitedId = invitedId, EventId = eventId }); switch (result.Status) { case RepositoryStatus.Created: return; case RepositoryStatus.NotFound: throw new ServiceException(ErrorCodes.EntityNotFound); case RepositoryStatus.BadRequest: throw new ServiceException(ErrorCodes.BadRequest); default: throw new ServiceException(ErrorCodes.DatabaseError); } }