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
Yes I know this looks like a duplicate from earlier versions of EF core, but it is clearly (to me at least) a bug.
If you have a SQL column of type bit having a default value of true and you model it in EF as a bool and configure the property in code-first with .HasDefaultValue(true), the when you add a new instance o the entity the generated SQL ignores a vale of false in the class instance supplied. It is incorrectly comparing the value to the CLR default value and deciding there is no need to explicitly set the value to false.
It should be comparing the value to the MODEL DEFAULT not the clr and realising that it does indeed need to include the property in the generated SQL.
The text was updated successfully, but these errors were encountered:
@martin-kelley We're not going to change this for 2.2, but we discussed in triage and I have opened #13224 to look at making this a better experience. Using the model default in some way may be something we could consider.
Yes I know this looks like a duplicate from earlier versions of EF core, but it is clearly (to me at least) a bug.
If you have a SQL column of type bit having a default value of true and you model it in EF as a bool and configure the property in code-first with .HasDefaultValue(true), the when you add a new instance o the entity the generated SQL ignores a vale of false in the class instance supplied. It is incorrectly comparing the value to the CLR default value and deciding there is no need to explicitly set the value to false.
It should be comparing the value to the MODEL DEFAULT not the clr and realising that it does indeed need to include the property in the generated SQL.
The text was updated successfully, but these errors were encountered: