Why should anonymous types cannot be passed around methods?

后端 未结 6 564
长情又很酷
长情又很酷 2021-01-22 04:27

What is the design decision to lean towards not returning an anonymous types from a method?

6条回答
  •  情话喂你
    2021-01-22 05:16

    Because C# is statically typed language and in a statically typed language the return type of a method needs to be known at compile time and anonymous types have no names.

提交回复
热议问题