Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

RianFuro/NHibernate.AspNetCore.Identity

 
 

Repository files navigation

ASP.NET Core Identity Provider for NHibernate

Nuget packages:

NHibernate.AspNetCore.Identity

ASPNET Core Identity provider that uses NHibernate for storage

public class Startup {

    public void ConfigureServices(
        IServiceCollection services
    ) {
        // Remove EFCore stores.
        // services.AddDbContext<ApplicationDbContext>(
        // options =>
        //     options.UseSqlite(Configuration.GetConnectionString("DefaultConnection")));
        // services.AddDefaultIdentity<IdentityUser>()
        //     .AddEntityFrameworkStores<ApplicationDbContext>();

        // Add Hibernate stores
        var path = System.IO.Path.Combine(
            AppDomain.CurrentDomain.BaseDirectory,
            "hibernate.config"
        );

        services.AddHibernate(path);
        services.AddDefaultIdentity<NHibernate.AspNetCore.Identity.IdentityUser>()
            .AddRoles<NHibernate.AspNetCore.Identity.IdentityRole>()
            .AddHibernateStores();

    }
}

For more detailed samples, please look at the WebTest project.

About

ASP.NET Core Identity Provider for NHibernate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.7%
  • Other 1.3%