Skip to content

Instantly share code, notes, and snippets.

Sipke Schoorstra sfmskywalker

Block or report user

Report or block sfmskywalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sfmskywalker
sfmskywalker / tenants.json
Created Jun 27, 2018
Tenants with custom settings
View tenants.json
{
"CustomerA": {
"State": "Running",
"RequestUrlHost": null,
"RequestUrlPrefix": "customer-a",
"CustomSetting": "Custom setting for Customer A"
},
"CustomerB": {
"State": "Running",
"RequestUrlHost": null,
@sfmskywalker
sfmskywalker / Startup.cs
Last active Jul 21, 2018
Startup with custom configuration
View Startup.cs
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Environment.Shell;
namespace MultiTenantApp
{
@sfmskywalker
sfmskywalker / Startup.cs
Created Jun 25, 2018
Complete Startup class
View Startup.cs
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace MultiTenantApp
{
public class Startup
View RemoteIpMessageProvider.cs
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
namespace MultiTenantApp.Features.RemoteIp
{
public class RemoteIpMessageProvider : IMessageProvider
{
private readonly IHttpContextAccessor _httpContextAccessor;
public RemoteIpMessageProvider(IHttpContextAccessor httpContextAccessor)
@sfmskywalker
sfmskywalker / Startup.cs
Created Jun 25, 2018
The Startup class for the RemoteIp feature
View Startup.cs
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
[assembly: OrchardCore.Modules.Manifest.Feature(
Id = "RemoteIp",
Name = "RemoteIp"
)]
namespace MultiTenantApp.Features.RemoteIp
{
View TimeOfDayMessageProvider.cs
using System.Threading.Tasks;
using OrchardCore.Modules;
namespace MultiTenantApp.Features.TimeOfDay
{
public class TimeOfDayMessageProvider : IMessageProvider
{
private readonly IClock _clock;
public TimeOfDayMessageProvider(IClock clock)
@sfmskywalker
sfmskywalker / Startup.cs
Created Jun 25, 2018
Startup class for the TimeOfDay feature
View Startup.cs
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
[assembly: OrchardCore.Modules.Manifest.Feature(
Id = "TimeOfDay",
Name = "TimeOfDay"
)]
namespace MultiTenantApp.Features.TimeOfDay
{
View IMessageProvider.cs
using System.Threading.Tasks;
namespace MultiTenantApp
{
public interface IMessageProvider
{
Task<string> GetMessageAsync();
}
}
@sfmskywalker
sfmskywalker / tenants.json
Last active Jun 27, 2018
Sample tenants.json
View tenants.json
{
"CustomerA": {
"State": "Running",
"RequestUrlHost": null,
"RequestUrlPrefix": "customer-a",
"CustomSetting": "Custom setting for Customer A",
"Features": [ "RemoteIp" ]
},
"CustomerB": {
"State": "Running",
@sfmskywalker
sfmskywalker / Startup.cs
Last active Jun 25, 2018
Root Startup file
View Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace MultiTenantApp
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
You can’t perform that action at this time.