I have a simple 'user' entity that has a 'RowId' (key), username (string), password (string), isenabled (bool), an enum (uint, has [Flags] attached with valid values: 1, 2, ..., 64) to define the type of user and 2 datetime fields to store initial / last login. I recreated the database (to start fresh), added a user using MSSql server management studio with valid information (for the enum value I entered '64', one of the valid options) and gave it a row id '0'. I loop over all 'User' entities, and it could correctly find the newly added user. I then tried adding the same user, but with a more valid row id '1'. I then queried for all of the 'User' entities, but only the '0' one that I left in could be found: the '1' entry wasn't found. Even worse, it did find 2 entries BUT the 2nd entry was 'null' Even worse, look at this screenshot: The 'Where' doesn't matter, I just added it as an extra test, but even with this code, the foreach returns 1 valid option (the '0') one and a 'null' reference. Whenever I add a row using the management studio with an id other than '0' it starts returning 'null' instead of the actual entity. Is there something special that I need to do if I want to add a new row manually using the management studio? Or is this a (known) bug? I do consider the fact that a 'Where (u => u != null)' can return a null absolutely a bug though. Since I only need 1 user currently to proceed my work, I'm ok for now, but soon I'll need a solution for this issue. Any aid would be greatly appreciated. |
In reply to Dmitri: Not here at least, should I be looking at other tables (this is the 'UserEntity' table) As you can see, I'm using ugly high row ids at the moment as a work around (I erased the username / password field for obvious reasons) |
TimM, Could you please check whether |
Hello TimM,
I absolutely agree that this could be considered as a weird behavior. I'll check this.