public GroupViewModel GetViewModel(int groupId, int userId) { if (!_groupMemberRepository.IsInGroup(groupId, userId)) { throw new ArgumentException("You are not a member of this group"); } var group = _groupRepository.Get(groupId); return(group.ToViewModel()); }