New4Magento New4Magento - 1 year ago 186 Question

ASP.NET Identity code convert from C# to VB.NET

Please Refer below Code snippest,

public partial class Startup
// For more information on configuring authentication, please visit
public void ConfigureAuth(IAppBuilder app)
// Configure the db context, user manager and role manager to use a single instance per request
app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create); .................

This above code snippest is found into Startup.cs file in my default MVC template.

I want to convert project into VB.NET. But I have issue to converting above four lines into VB.NET

Please let me know what is the sutaible syntax to convert this above lines.

Answer Source

Use AddressOf

app.CreatePerOwinContext(AddressOf ApplicationDbContext.Create)
app.CreatePerOwinContext(Of ApplicationUserManager)(AddressOf ApplicationUserManager.Create)
app.CreatePerOwinContext(Of ApplicationRoleManager)(AddressOf ApplicationRoleManager.Create)
app.CreatePerOwinContext(Of ApplicationSignInManager)(AddressOf ApplicationSignInManager.Create)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download