多租户应用程序设计
This commit is contained in:
1 parent
dbabaaadba
commit
49f2796cc2
24 files changed
+116
-25
No files matched your search
@@ -1,4 +1,7 @@
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
{
|
||||
public class CurrentTenant : ICurrentTenant
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
{
|
||||
public interface ICurrentTenant
|
||||
{
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
{
|
||||
public interface ITenantIdProvider
|
||||
{
|
||||
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
{
|
||||
@@ -10,7 +13,7 @@ namespace MultiTenancySample.ServiceDefaults
|
||||
|
||||
const string tenantKey = "tenant";
|
||||
|
||||
if(httpContext.User.FindAll(tenantKey).Any())
|
||||
if (httpContext.User.FindAll(tenantKey).Any())
|
||||
{
|
||||
return httpContext.User.FindFirst(tenantKey)?.Value;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
// Copyright (c) HelloShop Corporation. All rights reserved.
|
||||
// See the license file in the project root for more information.
|
||||
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace MultiTenancySample.ServiceDefaults
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user