I'm building a repository class and my find/get/etc method accept the standard LogicalBinaryExpression (x=>开发者_如何学编程;x.something == somethingElse)
I want to be able to create fake out my repository and use the LogicalBinaryExpression and cast or convert it to a MemberExpression so I can use it to set the value my FakeRepository returns.
For reference here is the code for my FakeRepository.
public TEntity First(Expression<Func<TEntity, bool>> predicate)
{
return Builder<TEntity>.CreateNew()
.With(predicate, true)
.Build();
}
精彩评论