Closed integral-llc closed 3 years ago
Unfortunately entity configurations like that are currently not supported. As of now, I can't tell how complex it would be to add support for it. However, currently, you can work-around this by passing your own key-factory to the call to CreateDbSetMock
:
dbContextMock.CreateDbSetMock(x => x.MarketPlaces, (e, _) => e.MarketplaceKey, initialEntities);
All of me Entities do not use attributes to mark the keys, everything is happening inside
OnModelCreating
override method. i.e.How to call this method so the keys are properly initialized? As of now, I'm getting an exception saying the entity
does not contain any property marked with KeyAttribute
.thx!