custom entity framework -- originally baked in 2004