You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw the following issue has been fixed as part of EF core 9 version upgrade, hence thought of trying in my project. #21006
After making the field as non-nullable and providing the default value, it worked while reading a particular document from the Azure Cosmos DB. However I was facing the issue while trying to read the specific attribute to make a decision.
For example,
I have a user model with the attributes like,
id
FirstName
LastName
...
I have decided to add a new attribute called
IsDeleted
I have kept this as non-nullable and provided the default as false in the model. This value isn't present for the existing documents.
With the EF core 9 upgrade, I am trying to read this user and I am able to see the user object is being populated with the value as false instead of null. But when I try to make a decision by checking the value of the attribute like below,
user = user.IsDeleted == false ? user : null;
Here it fails with the following error. Could you help me how to resolve this?
error CS0229: Ambiguity between 'UserModel.IsDeleted' and 'UserModel.IsDeleted' |
The text was updated successfully, but these errors were encountered:
I saw the following issue has been fixed as part of EF core 9 version upgrade, hence thought of trying in my project.
#21006
After making the field as non-nullable and providing the default value, it worked while reading a particular document from the Azure Cosmos DB. However I was facing the issue while trying to read the specific attribute to make a decision.
For example,
I have a user model with the attributes like,
id
FirstName
LastName
...
I have decided to add a new attribute called
IsDeleted
I have kept this as non-nullable and provided the default as false in the model. This value isn't present for the existing documents.
With the EF core 9 upgrade, I am trying to read this user and I am able to see the user object is being populated with the value as
false
instead of null. But when I try to make a decision by checking the value of the attribute like below,Here it fails with the following error. Could you help me how to resolve this?
The text was updated successfully, but these errors were encountered: