내가 좋아하는 IOC를 통해 설정, 일부 AOP 물건을 할 유니티와 함께 주위를 연주했습니다유니티 IOC, AOP 및 인터페이스 차단
ioc.RegisterType<ICustomerService, CustomerService>()
.Configure<Interception>().SetInterceptorFor<ICustomerService>(new InterfaceInterceptor());
... 다음 ICustomerService 인터페이스의 방법에 ICallHandler을 가진 . teh 시간 동안 나는 방금 호출 된 메소드, 그 클래스의 클래스 및 해당 클래스의 네임 스페이스를 가져 오려고합니다. 내가 input.MethodBase.DeclaringType.Name 전을 사용하는 경우 그래서 ... 안에 ...
public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext)
... ICallHandler 방법, 난 ... input.MethodBase.Name를 통해 메소드 이름에 액세스 할 수 있습니다 ICustomerService 인터페이스를 얻을 ...하지만 어떻게 인터페이스를 구현하는 대신 "CustomerService"클래스를 구현할 것인가?
나는 input.Target를 사용하는 들었어요 ..하지만 그건 그냥 "DynamicModule.ns.Wrapped_ICustomerService_4f2242e5e00640ab84e4bc9e05ba0a13"
이 사람들에 어떤 도움을 반환?