如何扩展现有的KeySelector

时间:2016-01-07 13:45:24

标签: c# expression-trees

[<Property(MaxTest=10)>]
let ``Calling unzipTo with an invalid destination will yield a failure.`` badDest =
    if Directory.Exists(badDest)
    then // somehow skip to the next randomized input
    else // do the actual test

我想拥有通用的AddressSortingSpecification。 _keySelector指向Address实体。如何添加城市或街道?

通常我可以写这样的东西:user.Address1.City

1 个答案:

答案 0 :(得分:1)

根据我的理解,您想知道如何创建表达式,以便在给定仅引用{{1}的表达式时访问City的{​​{1}}和Street属性}}。以下是我将如何做到这一点:

Address
相关问题