For a DataContext I m working on, I don t want to load the Tables untill their needed. I want to make a little method that would check if a certain Table is loaded before loading it, but I end up having n Methods doing the same thing :
private void Load(ref Table<Order> Orders)
{
if (Orders == null)
Orders = this.GetTable<Order>();
}
由于显而易见的原因,我试图作一个通用的编号,但我获得“T类必须是一种参考类型,以便作为通用型或方法系统的准参数。 资料来源:统计局。
private void Load<T>(ref Table<T> TableToLoad)
{
if (TableToLoad == null)
TableToLoad = this.GetTable<T>();
}