Call function in dynamic linq

后端 未结 7 837
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 21:13

I\'m trying to call a function in a dynamic linq select statement, but im getting error:

No property or field \'A\' exists in type \'Tuple2\'
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-31 21:52

    var b = new[]{ a };
    

    The above array is don't know what type of array , and it's not type safe ?

    Your values are assigned in variant data type so it's not integer value (I think string value) ,when you get this values in your query must need to convert.toint32() because your class parameter data type is integer

    Please try it

     var b = new **int**[]{ a }; 
    

    instead of var b = new[]{ a };

    The important hint is here (in bold):

    No property or field 'xxx' exists in **type** 'xxx'
    

    And Please look this for previous discussion :

    Dynamic Linq - no property or field exists in type 'datarow'

提交回复
热议问题