Unable to cast object of type 'System.Object[]' to 'MyObject[]', what gives?

前端 未结 6 1923
余生分开走
余生分开走 2021-02-19 17:57

Scenario:

I\'m currently writing a layer to abstract 3 similar webservices into one useable class. Each webservice exposes a set of objects that share commonality. I hav

6条回答
  •  清歌不尽
    2021-02-19 18:38

    That's correct, but that doesn't mean that you can cast containers of type Object to containers of other types. An Object[] is not the same thing as an Object (though you, strangely, could cast Object[] to Object).

提交回复
热议问题