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 should perhaps mention that the above scenario is motivated by the desire to clearly know the difference between a new entity and a persisted entity within the POCO object model. With a nullable id, it will default to null when an object is "newed up" clearly communicating that this is a non-persisted entity. However, an entity retrieved from entity framework will always have a non-null id).
I had a quick look at this, the expression is created at DbContextExtensions.cs:282. The comparison is written in an Expression and I can't assume a type for the Id. So it's going to be hard to know what to convert it to to ensure equality. Perhaps I can check to see if one is a Nullable and convert the other so that they are even. I'll look into this soon.
If you have an entity class like so:
public class Foo { Guid? Id { get; set; } }
and your database table is
create table dbo.Foo ( Id uniqueidentifier NOT NULL )
Then UpdateGraph fails with an exception that "there is no binary == operator between Guid? and Guid".
The text was updated successfully, but these errors were encountered: