-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dorin Simionescu
committed
Apr 2, 2024
1 parent
027aa46
commit eea2f84
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
12 changes: 10 additions & 2 deletions
12
src/MultiTenancy/NBB.MultiTenancy.Abstractions/Context/TenantContext.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
// Copyright (c) TotalSoft. | ||
// This source code is licensed under the MIT license. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace NBB.MultiTenancy.Abstractions.Context | ||
{ | ||
public class TenantContext | ||
{ | ||
public Tenant Tenant { get; } | ||
|
||
public Dictionary<string, object> Properties { get; set; } = []; | ||
public TenantContext(Tenant tenant) | ||
{ | ||
Tenant = tenant; | ||
} | ||
|
||
public TenantContext(Tenant tenant, Dictionary<string, object> properties) | ||
{ | ||
Tenant = tenant; | ||
Properties = properties; | ||
} | ||
|
||
public TenantContext Clone() | ||
{ | ||
return new TenantContext(new Tenant(Tenant.TenantId, Tenant.Code)); | ||
return new TenantContext(new Tenant(Tenant.TenantId, Tenant.Code), new Dictionary<string, object>(Properties)); | ||
} | ||
} | ||
} |