Giter VIP home page Giter VIP logo

aspnet-identity-ormlite's Introduction

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

aspnet-identity-ormlite's People

Contributors

adebisi-fa avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

jaouher1

aspnet-identity-ormlite's Issues

Error CS1929 'IDbConnection' does not contain a definition for 'FirstOrDefault'

Severity Code Description Project File Line Column Suppression State
Error CS1929 'IDbConnection' does not contain a definition for 'FirstOrDefault' and the best extension method overload 'Queryable.FirstOrDefault(IQueryable, Expression<Func<IdentityUser, bool>>)' requires a receiver of type 'IQueryable' AspNet.Identity.OrmLite g:\DOWNLOADS - IE FOLDER\aspnet-identity-ormlite-master\src\AspNet.Identity.OrmLite\UserStore.cs 68 40 Active

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.