Closed mikesalway closed 3 years ago
In case of keyless entities, you'll need to pass a key factory yourself.
This can be as simple as: (x, _) => x
to use the entire model as key or (x, _) => x.Id
if there is a property that can be used as a key (Id in this example).
The above is demonstrated in this unit-test
I have an entity from a view, with no key available and is marked with (entity.HasNoKey();) I therefore can't create mock entities, I just get this error
No key factory could be created for entity type
Any suggestions?