我创建了一个名为Attribute的RelatedPropertyAttribute类public classRelatedPropertyAttribute(string relatedProperty) RelatedProperty = relatedProperty;}public class MyClass public int Emp
特别是,我正在考虑F#的模式匹配功能,它允许非常丰富的语法-比当前的switch/conditional C#等价物更具表现力。我不会尝试给出一个直接的例子(我的F#不能胜任),但简而言之,它允许:
match by type (通过对区分的联合进行全覆盖检查)注意:这也推断出绑定变量的类型,给出成员访问etcmatch by<Func<TSource,TValue>>版本相媲美-作为第一个版本,但可