public class EntityFetcher<T> where T : BaseType public object GetById(int id) ObjectSet<T> objectSet = (ObjectSet<T>)GetTheObjectSet(typeof(T));
}如果T为Ba
我知道所有的结果都是ObjectSet<TEntity>类型的。我不知道TEntity。TEntity总是不同的。消费功能看起来很相似:如何将对象转换为ObjectSet?public static ObjectSet<T> MyConvert<T>(object myInput) where T : class
try using (Entities context = new Entities()) var ObjectSetforeach (string prop in NavigationProperties) ObjectSet.Include(prop).AsParallel().ToList();