Replies: 1 comment
-
In case it helps anyone, Mark Seeman pointed out to me that the first lambda in the For his explanation, please see this SO answer. Don't think I can close this discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The use case here is that I have added a method to an Entity Framework
DbContext
that does some extra work before saving, and then returns anEither
depending on the results. A very simplified version of this looks like this...This method is used in many places in my solution, and wors fine.
In one minimal API project, I have a method that looks like this (again, highly simplified)...
...where
DeviceApiResponseStates
is anenum
. For simplicity, you can imagine it looks like this...Those three code blocks are a complete sample of my problem.
I would expect that if I call
CreateDevice("jim")
, then I would get aLeft
with a value ofNah
, and if I call it with any other string value, I would get aRight
with a value of OK.However, when I try this...
... I get Nah, irrespective of the string value.
Anyone able to explain what I'm doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions