Entities without primary keys
If there is one or more entities without a primary key then the rest of the entities break on tracking:
Initialization method Dashing.Repository.Tests.CRUDTests.Test_Initialize threw exception. System.InvalidCastException: System.InvalidCastException: Unable to cast object of type 'Dashing.Model.Product' to type 'Dashing.CodeGeneration.ITrackedEntity'..
To reproduce add this class to TestDomain:
public class NoPrimary {
public virtual string Name { get; set; }
}
That does not surprise me in the slightest. Dashing makes a very definite assumption that you have a single column primary key defined on all tables.
What's your use case?
I used a T4 template to build all of my POCOs from an existing database. To get the POCOs with primary keys to work; I will need to delete all POCOs without primary keys.
What sort of tables are the ones without primary keys?
No idea on the effort involved but I could be persuaded to support tables without PKs if there are good reasons to do so.