2009-09-14 4 views

답변

0

MyTable 데이터 클래스에는 테이블 속성이 있어야합니다. 다음과 같이 할 수 있어야합니다.

 var tableType = db.MyTable.GetType().GetGenericArguments().First(); 
     foreach (TableAttribute attrib in tableType.GetCustomAttributes(false)) 
     { 
      Console.WriteLine(attrib.Name); 
     } 
+0

감사 BFree! -> ((TableAttribute) db.MyTable.GetType(). GetGenericArguments(). First(). GetCustomAttributes (false) .First()). – Zanoni

관련 문제