将IQueryable转换为另一种类型会引发错误“ System.NotsupportedException”

Class Base
    Property Id as integer
End Class    

Class A 
    Inherits Base

    Property Name as string 
    Property Address as string 
End Class

Friend Function GetFamily(***Of T As Base***)(ent As SysEntities,input As IQueryable(Of T)) As IQueryable(Of A)
-linq selector-

End Function

实际上T是A类型的,但是我无法查询其他参数,例如Name,address,因为它们在此阶段是未知的。 有一种使用Automapper扩展名( ProjectTo(Of T) )来Mapp它的解决方案,但我不应该使用它。

如果有人可以重播我的解决方案,那将不起作用。根据{{​​3}}提供的详细信息,它应该可以工作。

请注意,我不应该将Automapper用于相同的功能,而是microsoft的标准解决方案

kxp1125 回答:将IQueryable转换为另一种类型会引发错误“ System.NotsupportedException”

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3108162.html

大家都在问