ConvertUsing => Convert upgrade question #1791
GaryWayneSmith
started this conversation in
General
Replies: 2 comments 3 replies
-
For some reason I was missing that Value is an object. When inspecting it earlier it appeared that VS showed it as a string.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the code block below that has been working well for some time. Updating to the latest breaks this section. Reading the breaking changes I see that I need to use Convert. In the first line that can be handled easily, in the second line there is a dependency on a value from the current object that's other than .Value.
Any advice on how I would fix this to put it inline with the current release? I have about 60 such conversion in the code (not including normal custom conversions that are straight forward).
`
Map(m => m.InStock).Name("Availability").ConvertUsing(m => m.InStock ? "In Stock" : "Out of Stock");
Map(m => m.Inventory).Name("Quantity").ConvertUsing(m => m.InStock ? m.Inventory.ToString() : "0");
`
Beta Was this translation helpful? Give feedback.
All reactions