Skip to content

Instantly share code, notes, and snippets.

View Startup.cs
app.UseOrchardCore(a => a.Run(async context =>
{
// ShellSettings provide the tenant's configuration.
var shellSettings = context.RequestServices.GetRequiredService<ShellSettings>();
// Read the tenant-specific custom setting.
var customSetting = shellSettings.Configuration["CustomSetting"];
// Resolve all registered IMessageProvider services.
var messageProviders = context.RequestServices.GetServices<IMessageProvider>();
@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 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
{
View Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace AngularWidgetsDemo
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
@sfmskywalker
sfmskywalker / IncludeElements.cmd
Last active Jul 29, 2018
Add Angular Elements & Polyfill
View IncludeElements.cmd
cd ClientApp
ng add @angular/elements
@sfmskywalker
sfmskywalker / npm-install.cmd
Last active Jul 29, 2018
Executes the NPM Install command
View npm-install.cmd
cd ClientApp
npm install
ng build
@sfmskywalker
sfmskywalker / DownloadAngularElementSample.ps1
Last active Jul 29, 2018
Downloads and extracts a sample Angular Custom Element from GitHub
View DownloadAngularElementSample.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
Invoke-WebRequest -Uri https://github.com/nitayneeman/made-with-love/archive/release/v1.1.0.zip -OutFile ./ClientApp.zip
[System.IO.Compression.ZipFile]::ExtractToDirectory("c:\Code\Orchard Core and Angular\AngularWidgetsDemo\ClientApp.zip", "c:\Code\Orchard Core and Angular\AngularWidgetsDemo")
Rename-Item made-with-love-master ClientApp
@sfmskywalker
sfmskywalker / NewProject.cmd
Last active Jul 29, 2018
Create new ASP.NET Core Orchard Core Project
View NewProject.cmd
dotnet new web --name "AngularWidgetsDemo"
cd "AngularWidgetsDemo"
dotnet add package "OrchardCore.Application.Cms.Targets" --version 1.0.0-beta2-*
@sfmskywalker
sfmskywalker / InstallCodeGenerationTemplates.cmd
Created Jul 29, 2018
Installs the Orchard Core Code Generation Templates
View InstallCodeGenerationTemplates.cmd
dotnet new -i OrchardCore.Cms.Templates::1.0.0-beta2-*
You can’t perform that action at this time.