Using reflection to address a Linqed property
问题 I'm trying to writing a generic method that will load a record of a specific type, with a specific ID. Here's one way that works: public abstract class LinqedTable<T> where T : LinqableTable { public static T Get(long ID) { DataContext context = LinqUtils.GetDataContext<T>(); var q = from obj in context.GetTable<T>() where obj.ID == ID select obj; return q.Single<T>(); } } public abstract class LinqableTable { public abstract long ID { get; set; } } You can ignore the call to LinqUtils