Is there a significant difference between .Find(id)
and .Where(x = >x.Id == id)
that should compel me to use .Find()
over .Where()/.First()
?
I would imagine that .Find()
would be more efficient but is it so much more efficient that I should avoid .Where()/.First()
?
The reason I ask is that I am using a generic FakeDbSet in my tests to make it easy to implement fake results and so far I have found that I must inherit that class and provide a custom implementation of .Find()
whereas if I write my code with .Where()/.First()
I don't need to do that extra work.