You have to use the AddressOf
operator:
Protected Sub Application_BeginRequest()
GlobalConfiguration.Configure(AddressOf WebApiConfig.Register)
End Sub
Public Shared Sub Register(config As HttpConfiguration)
config.Routes.Clear()
End Sub
문제
Im having problem converting this to vb.net
c#
global.asax
protected void Application_BeginRequest()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
public static void Register(HttpConfiguration config)
{
config.Routes.Clear();
}
vb.net
Protected Sub Application_BeginRequest()
GlobalConfiguration.Configure(WebApiConfig.Register)
End Sub
Shared Function Register() As Action(Of HttpConfiguration)
End Function
I'm having problem in the version of vb.net on the register method. How can I access the parameter of the HttpConfiguration just like in c#.
해결책
You have to use the AddressOf
operator:
Protected Sub Application_BeginRequest()
GlobalConfiguration.Configure(AddressOf WebApiConfig.Register)
End Sub
Public Shared Sub Register(config As HttpConfiguration)
config.Routes.Clear()
End Sub