A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/linq2db/IdentityServer4.LinqToDB below:

linq2db/IdentityServer4.LinqToDB: LinqToDB persistence layer for IdentityServer4

IdentityServer4.LinqToDB is a persistence layer for IdentityServer4 configuration data that uses Linq To DB as it's database abstraction.

Project's source code is originally based on IdentityServer4.EntityFramework

Install package:

PM> Install-Package IdentityServer4.Contrib.Linq2db

All POCOs are under IdentityServer4.Contrib.LinqToDB.Entities namespace. Mostly POCOs are inherited from IdentityServer4.Models.* classes (to avoid unnesesary mapping), with adding only Id properties for identities and foreign keys. IdentityServer4.Models.Client.ClientId is used as promary key for Client entity. All Id's are identity by default.

Firstly you should create your connection factory as implementation of IdentityServer4.LinqToDB.Interfaces.IDataConnectionFactory, for example:

public class MyConnectionFactory : IDataConnectionFactory
{
    public DataContext GetContext() => new DataContext();
    public DataConnection GetConnection() => new DataConnection();
}

In your Strartup.cs

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    // ...
     
    // create factory instance 
    var factory = new MyConnectionFactory();

    services.AddIdentityServer() // Add IdentityServer
        .AddTemporarySigningCredential()
        // some other stuff

        // Configure Linq To DB storage for IdentityServer
        .AddConfigurationStore(factory)
        .AddOperationalStore(factory);

    // ...
      
    return services.BuildServiceProvider(true);
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4