Skip to content
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

Merged
merged 14 commits into from
Apr 1, 2022
Merged

feat(Isolation): Added isolation support #28

merged 14 commits into from
Apr 1, 2022

Conversation

zhenlei520
Copy link
Contributor

@zhenlei520 zhenlei520 commented Mar 31, 2022

Chore:

Docs

Feature:

Test

@zhenlei520 zhenlei520 added the enhancement New feature or request label Mar 31, 2022
@zhenlei520 zhenlei520 requested a review from doddgu March 31, 2022 07:31
if (_tenantContext != null)
stringBuilder.Append($"Tenant: [{_tenantContext.CurrentTenant?.Id ?? ""}]");
var message = stringBuilder.ToString();
return message.Substring(0, message.Length - 1);
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Tenant: [xxx]".Length - 1?

Copy link
Contributor Author

@zhenlei520 zhenlei520 Mar 31, 2022

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);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

processed

@zhenlei520 zhenlei520 requested a review from doddgu March 31, 2022 10:59
Copy link
Contributor

@doddgu doddgu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@doddgu doddgu merged commit 4c9f3f8 into main Apr 1, 2022
@zhenlei520 zhenlei520 deleted the feature/isolation branch April 1, 2022 03:46
@zhenlei520 zhenlei520 mentioned this pull request Apr 18, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants