So, I am considering creating a universal interface for interacting with my DataStorage from my objects, which I can change to use EF4 or SubSonic or NHibernate or some NoSQL option.
So, I have an ERD, and each table has an auto incrementing int column "TableNameID", which is the main key. I am trying to figure out how to get one record from a database using the primary key in a generic method
public T GetSingle<T>(int primaryKey) where T : class
How do you do this using EF4?
source
share