I am trying to use ternary to assign a decimal type. This does not work for me. I'm going crazy?
Here is a screenshot of my debugging. Before I take a step, you will see all the value. 
And after I take a step, this is the value. This is not even one of the viable options (for example, 1 or 2000). 
Is there some weird decimal restriction that I don't know about? When I break it down into a complete logical representation of if / else, it works fine. The only thing I can guess is that I recently installed the .NET Framework 4.5.
UPDATE
I cleared the solution and made sure that I was running code that was compiled in debug mode, as recommended in the comments. None of them seemed to change anything.
I was curious when I noticed that all my unit tests still passed. After a little closer look, I found that when I stepped again (that is, passed through memberItems.Add), the price magically had the right value in it.
Does .Net do some kind of deferred resolution of ternary operators, similar to the yield command in iterator blocks? I have never noticed this before, but I do not know what else could be. I believe that I could still work with code compiled in release mode randomly. I made more gross mistakes after triple checking myself.
source share