Loop is returning the completely wrong value.
I am using the Linqpad to test a pricing algorithm but the result at the is completely wrong. Instead of returning the multiplier rate I am getting the normal rate even tho I am hitting the correct if statement... I am very lost with this, ive been staring at the debugger for a while so I hope someone here can point me in the right direction.
output:
Basically the problem I am having is that the return should contain the Multiplier rate since its Sunday and its 19. I'm not really sure why I am stilling getting the normal rate. Ive used the debugger and it seems to be hitting the correct if statement so idk why the value thats getting printed outside the loop is wrong.
9 Replies
You are using mtreit's avatar. 🙂
Debug it
Not with LinqPad since it doesn't have a debugger
But, yeah, debug it
its working now : )
Cheers lads
The premium version actually has a debugger lmao 🤣 Its super useful icl
Clippy appreciation
Huh, I guess I just don't use Linqpad enough to need a debugger there lol
Yeh thats actually by design, the only stuff I want to calculate is the subTotal * by the rate depending what time it is etc & day of the week
Its like a scratchpad for me, I interact with the database with it etc
draft quick stuff
i cant live without it 🤣
What is
DateTime currentIntervalEnd = currentIntervalStart.AddMinutes(30);
for?its actually not being used tbf, i forgot to remove it before uploading this, my bad
oh shit
wait
Do u think? What would u change them to?
I'd definitely appreciate some advice, this is for my dissertation project
Its an E-Parking solution