This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "CustomerA": { | |
| "State": "Running", | |
| "RequestUrlHost": null, | |
| "RequestUrlPrefix": "customer-a", | |
| "CustomSetting": "Custom setting for Customer A" | |
| }, | |
| "CustomerB": { | |
| "State": "Running", | |
| "RequestUrlHost": null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class AuthenticatingHandler<T> : DelegatingHandler where T : ISecurityTokenAccessor | |
| { | |
| private readonly Policy<HttpResponseMessage> _policy; | |
| private readonly T _securityTokenAccessor; | |
| private IAccessToken _accessToken; | |
| private AuthenticationHeaderValue _authenticationHeader; | |
| public AuthenticatingHandler(T securityTokenAccessor) | |
| { | |
| _securityTokenAccessor = securityTokenAccessor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.Extensions.DependencyInjection; | |
| namespace AngularWidgetsDemo | |
| { | |
| public class Startup | |
| { | |
| public void ConfigureServices(IServiceCollection services) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dotnet new web --name "AngularWidgetsDemo" | |
| cd "AngularWidgetsDemo" | |
| dotnet add package "OrchardCore.Application.Cms.Targets" --version 1.0.0-beta2-* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm i -g @angular/cli | |
| ng new ClientApp --prefix custom |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ClientApp | |
| ng add @angular/elements |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ClientApp | |
| npm install | |
| ng build |