开发者

LogicalBinaryExpression to MemberExpression

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();
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜