How to call extension method “ElementAt”of List with reflection?

前端 未结 4 1950
清歌不尽
清歌不尽 2020-12-19 07:00

I have problem that after creating object \"oListType01\" of type List < MyClass01 > and after assigning it to the another objet \"oObjectType \" of type \"object\" I ca

4条回答
  •  借酒劲吻你
    2020-12-19 07:17

    This is really similar to your other question, but in this case, the static ElementAt method is actually requiring two parameters. Try this:

    object oSingleObject = mInfo.Invoke(null, new object[] { oObjectType, 1 });

提交回复
热议问题