public void Intercept(IInvocation invocation) { if (invocation.Method.DeclaringType.IsInterface || invocation.Method.HasAttribute <CompilerGeneratedAttribute>() ) { var propertyInfo = invocation.Method.GetPropertyInfo(); invocation.ReturnValue = _configValue.Value(propertyInfo); } else { invocation.Proceed(); } }
public void Intercept(IInvocation invocation) { if (invocation.Method.DeclaringType.IsInterface || invocation.Method.HasAttribute <CompilerGeneratedAttribute>() ) { object obj = _configValue.Value(invocation.Method.PropertyName()); invocation.ReturnValue = obj; } else { invocation.Proceed(); } }