Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 http://go.microsoft.com/fwlink/?LinkId=301864
    public void ConfigureAuth(IAppBuilder app)
    {
        // Configure the db context, user manager and role manager to use a single instance per request
        app.CreatePerOwinContext(ApplicationDbContext.Create);
        app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
        app.CreatePerOwinContext<ApplicationRoleManager>(ApplicationRoleManager.Create);
        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.

like image 901
New4Magento Avatar asked Dec 19 '25 14:12

New4Magento


1 Answers

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)
like image 193
Tim Schmelter Avatar answered Dec 23 '25 12:12

Tim Schmelter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!