Моя конкретная проблема заключается в объединении методов MethodInfoSelector. Я хотел бы написать что-то вроде этого:
Код: Выделить всё
public MethodInfoSelector AllActionMethods() {
return TestControllerType.Methods()
.ThatReturn()
.ThatAreNotDecoratedWith();
}
public static MethodInfoSelector ThatAreNotDecoratedWith(this IEnumerable selectedMethods) {
return (MethodInfoSelector)(selectedMethods.Where(method => !method.GetCustomAttributes(false).OfType().Any())); // this cast fails
}
Я был бы признателен за любую помощь в создании MethodInfoSelector или в другом подходе к основной проблеме перечисления методов, не имеющих определенного атрибута.
Подробнее здесь: https://stackoverflow.com/questions/240 ... oratedwith