나는 사용자 정의 핸들러 클래스 (entlib 4 정책 주입 응용 프로그램 블록을 사용하여) 내가 호출이 호출 될 때 입력 방법은 속성인지 알고 싶습니다에 적용 있어요. 다음은 내 처리기가 보이는 것입니다.메소드가 Policy Injection의 속성인지 확인하는 가장 좋은 방법은 무엇입니까?
[ConfigurationElementType(typeof(MyCustomHandlerData))]
public class MyCustomHandler : ICallHandler
{
public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext)
{
if (input.MethodBase.IsPublic && (input.MethodBase.Name.Contains("get_") || input.MethodBase.Name.Contains("set_")))
{
Console.WriteLine("MyCustomHandler Invoke called with input of {0}", input.MethodBase.Name);
}
return getNext().Invoke(input, getNext);
}
public int Order { get; set; }
}
당신이 내 코드 샘플, 나는 메소드 이름을 분석하여 지금까지 IS 생각했습니다 최선의 방법에서 볼 수 있듯이. 이것을 할 수있는 더 좋은 방법이 없을까요?