You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can rewrite your definition to make it "projection compatible":
[Mapper]publicstaticpartialclassProductMapper{// one option[MapProperty([nameof(Product.IdentifierConfig), nameof(Product.IdentifierConfig.MachineId)],[nameof(ProductListItemResp.MachineId)])]// another option[MapPropertyFromSource(nameof(ProductListItemResp.MachineName), Use = nameof(MapMachineName))]// etcpublicstaticpartial ProductListItemResp ToListItemResp(Productproduct);[UserMapping(Default =false)]// this prevents general Project => string mappingprivatestaticstringMapMachineName(Productproduct)=> product.IdentifierConfig?.Machine?.Name;publicstaticpartialIQueryable<ProductListItemResp>ToListItemQueryableResp(thisIQueryable<Product>product);}
Before and after mappings are not supported in projection (they can not be supported).
Describe the bug
before/ after map can't work well with IQueryable projections
Declaration code
Actual relevant generated code
Expected relevant generated code
Environment (please complete the following information):
Additional context
Nothing
The text was updated successfully, but these errors were encountered: