更新时间:2023-01-01 08:20:25
比上面容易得多,并且不需要反射. Linq to SQL具有Mapping属性,可用于获取所有表的枚举.
It's much easier than above and no reflection required. Linq to SQL has a Mapping property that you can use to get an enumeration of all the tables.
context.Mapping.GetTables();