Make IDataContext.SyncObjectState generic?

Jul 8, 2014 at 4:27 PM
Hello Le,

Again, not an issue per-se. SyncObjectState currently takes an object, forcing the implementer to do casting from object, and also not enforcing compile time checking that the entity passed actually implements IObjectState.

DbEntityEntryEntry (which the EF implementation needs to reference) is generic, so would it make sense to make the interface member as follows:
void SyncObjectState<T>(T entity) where T : class, IObjectState;
Commit: GenericUnitOfWorkABContrib dev-1229: 376a4de2

Jul 8, 2014 at 7:57 PM
Marked as answer by lelong37 on 7/8/2014 at 11:57 AM