Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mcrio/Mcrio.Finbuckle.MultiTenant.RavenDb.Store

RavenDB implementations of the Finbuckle.MultiTenant store.
https://github.com/mcrio/Mcrio.Finbuckle.MultiTenant.RavenDb.Store

Last synced: about 2 months ago
JSON representation

RavenDB implementations of the Finbuckle.MultiTenant store.

Awesome Lists containing this project

README

        

RavenDB
Finbuckle Multitenant

# Finbuckle Multi-Tenant on RavenDB

[![Build status](https://dev.azure.com/midnight-creative/Mcrio.Finbuckle.MultiTenant.RavenDb.Store/_apis/build/status/Build)](https://dev.azure.com/midnight-creative/Mcrio.Finbuckle.MultiTenant.RavenDb.Store/_build/latest?definitionId=7)
![Nuget](https://img.shields.io/nuget/v/Mcrio.Finbuckle.MultiTenant.RavenDb.Store)

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](https://www.finbuckle.com).

## Getting Started

### NuGet Package

Using the NuGet package manager install the [Mcrio.Finbuckle.Multitenant.RavenDb.Store](https://www.nuget.org/packages/Mcrio.Finbuckle.MultiTenant.RavenDb.Store) package, or add the following line to the .csproj file:

```xml

```

## Usage

Add the following lines to Startup.cs.
```c#
// ConfigureServices(...)
services
// adds finbuckle support as per official documentation
.AddMultiTenant()
// adds RavenDb store by providing Tenant info type and RavenDb store type.
// both can be extended to suit your requirements
.WithRavenDbStore>(
// define how IAsyncDocumentSession is resolved from DI
// as library does NOT directly inject IAsyncDocumentSession
provider => provider.GetRequiredService().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`
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](https://ravendb.net/docs/article-page/5.2/working-with-document-identifiers/client-api/document-identifiers/working-with-document-identifiers) 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](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