Skip to content

Issues mapping some some collection properties and dates with IQueryable #1380

Closed Answered by latonz
Atulin asked this question in Q&A
Discussion options

You must be logged in to vote

Note: you need to apply the MapProperty to a mapping method with the classes as parameter / return types, not wrapped in IQueryable. Otherwise Mapperly tries to apply the MapProperty attribute to the IQueryable which doesn't have these properties.

public static partial IQueryable<StoryDetails> ProjectToDetails(this IQueryable<Story> q);

[MapProperty(...)]
private static partial StoryDetails Map(Story source);

Mapperly will pick up the configuration from the Map method whenever mapping from Story to StoryDetails.
See also the documentation.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Atulin
Comment options

@latonz
Comment options

Answer selected by Atulin
@Atulin
Comment options

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