Closed IvanZheng closed 5 years ago
.Find()
is a convenience method baked into EF Core that makes a lot of bad assumptions. I have no control over how it works, including the fact that it assumes certain Equality aspects of the generic type parameter (without actually making those assumptions into type constraints).
Use an appropriate .Where()
clause on the DbSet to filter on the key, since that's all that .Find
really attempts to build for you anyway.
Got it. I can adapt it myself.
Hi @crhairr , zooDbContext.Employees .Find(ObjectId.GenerateNewId()) will throw exception "System.InvalidOperationException : The operands for operator 'Equal' do not match the parameters of method 'op_Equality'". Please help to investigate it. It also blocks my project.