-
Notifications
You must be signed in to change notification settings - Fork 483
Closed
Description
Hi,
I've a simple class:
public class MyClass
{
public virtual void MyMethod(string str = null)
{
Console.WriteLine(str);
}
}
When I check
typeof(MyClass).GetMethod("MyMethod").GetParameters()[0].DefaultValue
it's null (as expected). But if I create a dynamicproxy
var gen = new ProxyGenerator(new DefaultProxyBuilder());
var proxy = gen.CreateClassProxy<MyClass>();
Then I check
proxy.GetType().GetMethod("MyMethod").GetParameters()[0].DefaultValue
It is not null, it is System.Reflection.Missing
This causes a problem when I proxy an ASP.NET MVC Controller with a method which has a default parameter as null such which is defined as:
public virtual ActionResult Login(string returnUrl = "/", string loginMessage = null)
I use proxy since I want to intercept the method call.
Is this a bug or known situation.
Metadata
Metadata
Assignees
Labels
No labels