Make IDataContext.SyncObjectState generic?

Developer
Jul 8, 2014 at 3: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

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