Skip to content

Orchard Core module that allows tenants to host their own services.

License

Notifications You must be signed in to change notification settings

visuscore/VisusCore.TenantHostedService

Repository files navigation

Tenant Hosted Service

About

Orchard Core module that allows tenants to host their own services similar to Background tasks with hosted services in ASP.NET Core but on the tenant level.

Usage

To integrate the tenant hosted service infrastructure into Orchard Core, you can invoke the OrchardCoreBuilderExtensions.AddTenantHostedService method. This method adds the necessary configurations and components to enable the management and execution of hosted services specific to each tenant within the Orchard Core framework.

using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using VisusCore.TenantHostedService.Extensions;

var builder = WebApplication.CreateBuilder(args);

- builder.Services.AddOrchardCms();
+ builder.Services.AddOrchardCms(builder => builder.AddTenantHostedService());

var app = builder.Build();

if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error");
    app.UseHsts();
}

app.UseStaticFiles();
app.UseOrchardCore();

app.Run();

Features

Tenant Hosted Service Host

The purpose of this is to identify whether a feature is enabled or disabled for a tenant. It will be enabled for every tenant through OrchardCoreBuilderExtensions.AddTenantHostedService.

Tenant Hosted Service Loader

The objective of this is to designate the tenant for the hosted service manager to load the hosted services specific to that tenant.

Samples

If you're interested in observing the entire functionality in practice, take a look at the Samples project.

About

Orchard Core module that allows tenants to host their own services.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published