Anonymous Types

前端 未结 5 885
北恋
北恋 2021-01-12 17:41

I have a Dictionary(TKey, TValue) like

Dictionary Deduction_Employees = 
    new Dictionary();

5条回答
  •  無奈伤痛
    2021-01-12 18:01

    No you can't. You can only access the properties by using reflection. The compiler has no way of knowing what the type was, and since it's an anonymous type, you can't cast it either.

提交回复
热议问题