且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从 LINQ DataContext 中的表名获取表数据

更新时间:2023-02-26 09:41:22

给定 DataContext contextstring tableName,你可以说:

Given DataContext context and string tableName, you can just say:

var table = (ITable)context.GetType()
                           .GetProperty(tableName)
                           .GetValue(context, null);