我有一个类型和对象,我需要将该对象转换为该类型。这是我的示例代码:
foreach (object o in eTable)
{
var type = (typeof(ERPEntities).GetProperty(TableName).PropertyType);
// this is the static conversion but i need the dynamic one to generalize the code
var dasd = o as GN_Nationalities;
}