MockQueryable icon indicating copy to clipboard operation
MockQueryable copied to clipboard

Supporting `EF.Functions.Like` and/or prossibility to provide cusotm `ExpressionVisitor`

Open InspiringCode opened this issue 1 year ago • 1 comments

Is there any chance that you can support the most common EF functions like EF.Functions.Like?

An relatively simple approach might be to write an ExpressionVisitor that replace those function calls with mock functions.

I think it would generally be a great idea to add an optional Visitor property to TestAsyncEnumerableEfCore<T> where you can pass a custom visitor that is used instead of the new TestExpressionVisitor(). This would allow developers to mock all sorts of custom functions and the like.

I would really appreciate this feature.

InspiringCode avatar Jan 24 '24 12:01 InspiringCode

Hello @InspiringCode I also think this is indeed a great idea to implement functionality to support EF.Functions.Like, but unfortunately I will not have enough time to implement it. Feel free to provide a pull request with the infrastructure and I would be happy to include it to the next release. Please don't forget to cover the case by additional tests to minimize possibility of regressions for the future. Thanks for the understanding.

romantitov avatar Jan 25 '24 12:01 romantitov