Does the C# 4.0 “dynamic” keyword make Generics redundant?

后端 未结 5 2105
故里飘歌
故里飘歌 2021-01-02 09:55

I\'m very excited about the dynamic features in C# (C#4 dynamic keyword - why not?), especially because in certain Library parts of my code I use a lot of reflection.

5条回答
  •  孤独总比滥情好
    2021-01-02 09:57

    Answer to the second question: You can return anonymous types in C# 3.0. Cast the type to object, return it and use reflection to access it's members. The dynamic keyword is just syntactic sugar for that.

提交回复
热议问题