-
Notifications
You must be signed in to change notification settings - Fork 4
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
[CORELIB-182] Fix dotnet and rider warnings, remove StyleCop leftovers #750
Conversation
src/CQRS/LeanCode.CQRS.AspNetCore/Registration/CQRSObjectsRegistrationSource.cs
Outdated
Show resolved
Hide resolved
test: Run #2114
🎉 All tests passed!🔄 This comment has been updated |
src/CQRS/LeanCode.CQRS.AspNetCore/Registration/ServiceCollectionRegistrationExtensions.cs
Outdated
Show resolved
Hide resolved
src/Infrastructure/LeanCode.OpenTelemetry/IdentityTraceAttributesMiddleware.cs
Outdated
Show resolved
Hide resolved
test/Core/LeanCode.Components.Startup.Tests/LeanStartupTests.cs
Outdated
Show resolved
Hide resolved
test/Testing/LeanCode.IntegrationTestHelpers.Tests/App/Startup.cs
Outdated
Show resolved
Hide resolved
src/CQRS/LeanCode.CQRS.AspNetCore/Local/Context/LocalCallContext.cs
Outdated
Show resolved
Hide resolved
a43f35e
to
95f7bcc
Compare
src/CQRS/LeanCode.CQRS.MassTransitRelay/Testing/ResettableBusActivityMonitor.cs
Outdated
Show resolved
Hide resolved
src/Tools/LeanCode.CodeAnalysis/CodeActions/FixCQRSHandlerNamespaceCodeAction.cs
Outdated
Show resolved
Hide resolved
test/Domain/LeanCode.DomainModels.EF.Tests/ModelBuilderExtensionsTests.OptimisticConcurrency.cs
Outdated
Show resolved
Hide resolved
@@ -49,6 +50,7 @@ public override ISession Session | |||
set { } | |||
} | |||
|
|||
[SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")] |
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.
Just a question, does it have a problem with the properties set here?
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.
Yes setting it in constructor. https://www.jetbrains.com/help/rider/VirtualMemberCallInConstructor.html For example this might fail:
public class CustomContext : LocalCallContext
{
private string prefix;
public CustomContext(
IServiceProvider requestServices,
ClaimsPrincipal user,
string? activityIdentifier,
IHeaderDictionary? headers,
CancellationToken cancellationToken
)
: base(requestServices, user, activityIdentifier, headers, cancellationToken)
{
prefix = "test_";
}
public override string TraceIdentifier
{
get => base.TraceIdentifier;
set => base.TraceIdentifier = $"{prefix}{value}";
}
}
var context = new CustomContext(
requestServices: serviceProvider,
user: user,
activityIdentifier: "123",
headers: null,
cancellationToken: CancellationToken.None
);
Because base constructor runs first and calls overridden setter but CustomContext
constructor has not run yet and prefix is not initialized so we might get something like Object reference not set to an instance of an object.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## v9.0-preview #750 +/- ##
===================================
===================================
☔ View full report in Codecov by Sentry. |
No description provided.