I want to use condition expression to choose lambda expression, like that:
xxxx.UsingFactory(
hasProofing? ( ()=>new ProofingA() ) : ( () => new ProofingB() )
);
But, it show me errors. So, if I want to do this thing, How should I do.
Error Detail:
no implicit conversion between 'lambda expression' and 'lambda expression'
UsingFactory, what does it accept as parameters ? DoProofingAandProofingBinherit from the same object ?xxx.UsingFactory()takes as parameter? may be it does not take an Action without parameters? tryx=>new ProfingA()Func<iThatComonInterface>or accepts what exactly ? Just anAction?