Skip to content

How can I create an index for multiple values #10243

Answered by jtkech
MikeAlhayek asked this question in Q&A
Discussion options

You must be logged in to vote

To return many ones you just need to return an enumerable, there is a map overload for this

E.g. here a piece of code that I use in an index map

                var countryIds = trackPart.Countries.ContentItemIds;
                if (countryIds == null || countryIds.Length == 0)
                {
                    return null;
                }

                var results = new List<TrackCountryIndex>();
                var albumId = track.As<ContainedPart>()?.ListContentItemId;

                foreach (var countryId in countryIds)
                {
                    results.Add(new TrackCountryIndex
                    {
                        TrackId = track.ContentItemId,
      …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@MikeAlhayek
Comment options

MikeAlhayek Sep 11, 2021
Collaborator Author

@jtkech
Comment options

@MikeAlhayek
Comment options

MikeAlhayek Sep 11, 2021
Collaborator Author

@jtkech
Comment options

Answer selected by MikeAlhayek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants