Skip to content

An AspNet Identity provider implemented with ServiceStack.OrmLite.v3 (last version was 3.9.71). This provider can be used with all RDBMS that has a OrmLite Dialect.

License

Notifications You must be signed in to change notification settings

jaouher1/aspnet-identity-ormlite

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServiceStack.OrmLite.v3 AspNet Identity Provider

An AspNet Identity provider implemented with ServiceStack.OrmLite.v3 (last version was 3.9.71). This provider can be used with all RDBMS that has a OrmLite Dialect (about eight (8)).

Installation

Install-Package AspNet.Identity.OrmLite

Usage

  1. Create an implementation of IDbConnectionFactory, using the OrmLite Dialect for the RDMS you are targeting, as follows:
  var factory = new OrmLiteConnectionFactory(
      
      /* Rdms-dependent-connection-string */
      "...",  

      /* provider specific dialet here e.g. MySqlDialect.Provider, SQLiteDialect.Provider, etc */
      SqlServerDialect.Provider 
      
  );

NOTE:

Nuget your RDMBS's OrmLite package.  There are currently eight (8) flavours of OrmLite on NuGet (see list below).   __HEADS-UP: You must INSTALL version 3.9.71 of your package to use this OrmLite provider).   

This identity provider come pre-packaged with MSSQL Server OrmLite, i.e. ServiceStack.OrmLite.SqlServer. Hence, you are not required to install it again when targetting SQL Server.

  1. Create an instance of OrmLiteIdentityDbContext instance using the created IDbConnectionFactory.
    var context = new OrmLiteIdentityDbContext(factory); 
  1. Create Asp.Net Identity UserManager and RoleManager like so:
    var userManager = new UserManager<IdentityUser>(new UserStore(context));
    // Optionally configure userManager instance
    // Optionally store in a IoC Container
    // ....
    
    var roleManager = new RoleManager<IdentityRole>(new RoleStore(context));
    // Optionally configure roleManager (e.g. RoleValidator)
    // Optionally store in a IoC Container

About

An AspNet Identity provider implemented with ServiceStack.OrmLite.v3 (last version was 3.9.71). This provider can be used with all RDBMS that has a OrmLite Dialect.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%