c# - Cast lambda expression to derived type -


i need little piece of magic. believe trying makes sense, if i've not seen problem plan reasons why welcome.

i have expression

expression<func<entity, bool>>

and want cast/convert or create whole new expression:

expression<func<derived, bool>>

this being used ef filter query, passed argument repository method. repository returns enumerable of entity, use covariance easy enough, want post processing on query in it's derived state before returning it.

it seems me ef must doing internally, i'd able run query type of result derived type rather entity.

thanks helping.

if have expression expression<func<entity, bool>> can add cast<derived> filter down entities of specific type.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -