0
我有2类: - BasePageElement(父) 和行动(BasePageElement的孩子)。不能键入 '表达<System.Func <TP,Action>>' 转换为 '表达<System.Func <TP,BasePageElement >>'
我有2种方法:
public void Click(Expression<Func<TP, Action>> action)
{
WaitSomething(action);
some code
}
public void WaitSomething(Expression<Func<TP, BasePageElement>> action)
{
}
所以我在点击方法的问题,因为类型表达< Func键< TP,动作>>无法转换为表达< Func键< TP,BasePageElement >>
如何我可以解决吗?
我如何手动将Expression>转换为Expression >? –
iPogosov
您需要编写一个转换器函数,将Action从Expression中移出并将其转换为BasePageelement。 – Thomas