You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AppBuilderUseExtensions.Use extension method cannot be used in VB (except by calling it explicitly) because its name conflicts with an instance method ( IAppBuilder.Use ) that accepts any number of object parameters and, thus, will always take precedence.
Probably due to the fact that lambda expressions can be implicitly converted to delegates in VB. This code works for C#.
But the VB equivalent does not. Instead of calling the extension method, it calls the instance method.
app.Use(Async Function(context, [next]) As Task
Using AsyncScopedLifestyle.BeginScope(container)
Await [next]()
End Using
End Function)
The extension has to be called explicitly in VB.
AppBuilderUseExtensions.Use(app, Async Function(context, [next]) As Task
Using AsyncScopedLifestyle.BeginScope(container)
Await [next]()
End Using
End Function)
The text was updated successfully, but these errors were encountered:
This is unfortunate but I don't know that there's a clear way to fix it. Happy to consider a contribution if someone has a non-breaking way to do this!
AppBuilderUseExtensions.Use extension method cannot be used in VB (except by calling it explicitly) because its name conflicts with an instance method ( IAppBuilder.Use ) that accepts any number of object parameters and, thus, will always take precedence.
Probably due to the fact that lambda expressions can be implicitly converted to delegates in VB. This code works for C#.
But the VB equivalent does not. Instead of calling the extension method, it calls the instance method.
The extension has to be called explicitly in VB.
The text was updated successfully, but these errors were encountered: