-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Isolation): Added isolation support #28
Conversation
src/Isolation/Masa.Contrib.Isolation.MultiTenancy/TenancySaveChangesFilter.cs
Outdated
Show resolved
Hide resolved
if (_tenantContext != null) | ||
stringBuilder.Append($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}]"); | ||
var message = stringBuilder.ToString(); | ||
return message.Substring(0, message.Length - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tenant: [xxx]".Length - 1? And both null, Length - 1 = -1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stringBuilder cannot be null, at least one of _environmentContext and _tenantContext exists, which is restricted in UseIsolationUoW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Tenant: [xxx]".Length - 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was wrong before, now it is
private string GetMessage()
{
StringBuilder stringBuilder = new StringBuilder();
if (_environmentContext != null)
stringBuilder.Append($"Environment: [{_environmentContext.CurrentEnvironment}], ");
if (_tenantContext != null)
stringBuilder.Append($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}], ");
var message = stringBuilder.ToString();
return message.Substring(0, message.Length - 2);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processed
src/Isolation/Masa.Contrib.Isolation.UoW.EF/Internal/TypeCommon.cs
Outdated
Show resolved
Hide resolved
src/Isolation/Masa.Contrib.Isolation.UoW.EF/Parser/MultiTenancy/HeaderTenantParserProvider.cs
Outdated
Show resolved
Hide resolved
…ent class name to IMultiEnvironment
a4259ce
to
7ff7d47
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Chore:
Docs
Feature:
Test