GithubHelp home page GithubHelp logo

mcrio.finbuckle.multitenant.ravendb.store's Introduction

RavenDB

Finbuckle Multitenant

Finbuckle Multi-Tenant on RavenDB

Build status Nuget

RavenDB implementation of the Finbuckle.MultiTenant store.

What is Finbuckle Multi-Tenant

Finbuckle.MultiTenant is open source multi-tenancy middleware for .NET. For more information about Finbuckle.MultiTenant visit the official website.

Getting Started

NuGet Package

Using the NuGet package manager install the Mcrio.Finbuckle.Multitenant.RavenDb.Store package, or add the following line to the .csproj file:

<ItemGroup>
    <PackageReference Include="Mcrio.Finbuckle.Multitenant.RavenDb.Store"></PackageReference>
</ItemGroup>

Usage

Add the following lines to Startup.cs.

// ConfigureServices(...)
services
    // adds finbuckle support as per official documentation
    .AddMultiTenant<TenantInfo>()
    // adds RavenDb store by providing Tenant info type and RavenDb store type.
    // both can be extended to suit your requirements
    .WithRavenDbStore<TenantInfo, FinbuckleRavenDbStore<TenantInfo>>(
        // define how IAsyncDocumentSession is resolved from DI
        // as library does NOT directly inject IAsyncDocumentSession
        provider => provider.GetRequiredService<IAsyncDocumentSession>().Session
    )

Custom Tenant info data

Extend Finbuckle.MultiTenant.TenantInfo or Finbuckle.MultiTenant.ITenantInfo and provide types when adding Finbuckle.MultiTenant and the RavenDb store.

Paginated results

FinbuckleRavenDbStore implements Mcrio.Finbuckle.MultiTenant.RavenDb.Store.Interfaces.IHavePaginatedMultiTenantStore<TTenantInfo> which can be used to retrieve a paginated tenant list.

Compare Exchange key prefixes

Unique tenant identifiers are handled by the compare exchange. Compare exchange key prefixes can be modified by following:

  • Extend FinbuckleRavenDbStore and override protected virtual CompareExchangeUtility CreateCompareExchangeUtility() to return an extended CompareExchangeUtility that will override the functionality for generating compare exchange key prefixes. See CompareExchangeUtility.GetKeyPrefix for predefined compare exchange key prefixes.

ID generation

If using the provided Finbuckle.MultiTenant.TenantInfo class, Id can be changed after object construction. By default set to null which implies HiLo identifier generation. Refer to official RavenDB document about identifier generation strategies.

Release History

  • 1.0.0 Stable version.

Meta

Nikola Josipović

This project is licensed under the MIT License. See License.md for more information.

Do you like this library?

₳ ADA | Buy me a coffee or two :)
addr1q87dhpq4wkm5gucymxkwcatu2et5enl9z8dal4c0fj98fxznraxyxtx5lf597gunnxn3tewwr6x2y588ttdkdlgaz79spp3avz

Ξ ETH | ...a nice cold beer :)
0xae0B28c1fCb707e1908706aAd65156b61aC6Ff0A

฿ BTC | ...or maybe a good read :)
bc1q3s8qjx59f4wu7tvz7qj9qx8w6ktcje5ktseq68

Happy if you stake ADA with Pale Blue Dot [PBD]
https://palebluedotpool.org
 

mcrio.finbuckle.multitenant.ravendb.store's People

Contributors

mcrio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.