79354751

Date: 2025-01-14 10:57:23
Score: 1.5
Natty:
Report link

Ok, this report will go into "The Twilgiht Zone" category.

@David Browne - microsoft and @Steve Py, your comments were enough to make me dug further.

As you suggested this wouldn't be an EF issue I rechecked my code. I found out that in MAUI project I defined PROJECT_TABLET for android target only, but I run code on Windows target. Therefore, the code was properly compiled against DatabaseGeneratedOption.Computed.

Clean and recompile after fix and the problem is solved, as expected.

Still, it made we wonder why I didn't get compile-time error in the line

#if !PROJECT_TABLET
   This is not code and will generate compile time error.
#endif

But I can't reproduce this behavior. I tend to triple check my code before posting and I'm 100% sure that I copied SQL code generated while test code above included. Either my memory crashed miserably or I felt in VS2022/MAUI hole with clean-delete-close reboot. I'll never know...

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @David
  • User mentioned (0): @Steve
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user29151663