Skip to content

Commit 72fd6dd

Browse files
Update .NET SDK to 10.0.100-preview.4.25180.3 (#61244)
* Update .NET SDK Update .NET SDK to version 10.0.100-preview.4.25180.3. --- updated-dependencies: - dependency-name: Microsoft.NET.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Fix IDE0031 warnings * Fix more IDE0031 warnings --------- Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Stephen Halter <halter73@gmail.com>
1 parent 4fc6e31 commit 72fd6dd

File tree

15 files changed

+22
-83
lines changed

15 files changed

+22
-83
lines changed

Diff for: global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"sdk": {
3-
"version": "10.0.100-preview.4.25177.17"
3+
"version": "10.0.100-preview.4.25180.3"
44
},
55
"tools": {
6-
"dotnet": "10.0.100-preview.4.25177.17",
6+
"dotnet": "10.0.100-preview.4.25180.3",
77
"runtimes": {
88
"dotnet/x86": [
99
"$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)"

Diff for: src/Components/Server/src/Circuits/CircuitHost.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,7 @@ await HandleInboundActivityAsync(() =>
828828
operation.Descriptor.ComponentType,
829829
operation.Marker.Value.Key,
830830
operation.Descriptor.Parameters);
831-
if (pendingTasks != null)
832-
{
833-
pendingTasks[i] = task;
834-
}
831+
pendingTasks?[i] = task;
835832
break;
836833
case RootComponentOperationType.Update:
837834
// We don't need to await component updates as any unhandled exception will be reported and terminate the circuit.

Diff for: src/Hosting/Hosting/src/Http/DefaultHttpContextFactory.cs

+3-12
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ internal void Initialize(DefaultHttpContext httpContext, IFeatureCollection feat
5858

5959
httpContext.Initialize(featureCollection);
6060

61-
if (_httpContextAccessor != null)
62-
{
63-
_httpContextAccessor.HttpContext = httpContext;
64-
}
61+
_httpContextAccessor?.HttpContext = httpContext;
6562

6663
httpContext.FormOptions = _formOptions;
6764
httpContext.ServiceScopeFactory = _serviceScopeFactory;
@@ -72,18 +69,12 @@ internal void Initialize(DefaultHttpContext httpContext, IFeatureCollection feat
7269
/// </summary>
7370
public void Dispose(HttpContext httpContext)
7471
{
75-
if (_httpContextAccessor != null)
76-
{
77-
_httpContextAccessor.HttpContext = null;
78-
}
72+
_httpContextAccessor?.HttpContext = null;
7973
}
8074

8175
internal void Dispose(DefaultHttpContext httpContext)
8276
{
83-
if (_httpContextAccessor != null)
84-
{
85-
_httpContextAccessor.HttpContext = null;
86-
}
77+
_httpContextAccessor?.HttpContext = null;
8778

8879
httpContext.Uninitialize();
8980
}

Diff for: src/Http/Http/src/HttpContextAccessor.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,8 @@ public HttpContext? HttpContext
2222
}
2323
set
2424
{
25-
var holder = _httpContextCurrent.Value;
26-
if (holder != null)
27-
{
28-
// Clear current HttpContext trapped in the AsyncLocals, as its done.
29-
holder.Context = null;
30-
}
25+
// Clear current HttpContext trapped in the AsyncLocals, as its done.
26+
_httpContextCurrent.Value?.Context = null;
3127

3228
if (value != null)
3329
{

Diff for: src/Middleware/Rewrite/src/RewriteMiddleware.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public Task Invoke(HttpContext context)
7777
// An endpoint may have already been set. Since we're going to re-invoke the middleware pipeline we need to reset
7878
// the endpoint and route values to ensure things are re-calculated.
7979
context.SetEndpoint(endpoint: null);
80-
var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
81-
if (routeValuesFeature is not null)
82-
{
83-
routeValuesFeature.RouteValues = null!;
84-
}
80+
context.Features.Get<IRouteValuesFeature>()?.RouteValues = null!;
8581
return _options.BranchedNext(context);
8682
}
8783
}

Diff for: src/Middleware/Rewrite/src/UrlActions/CustomResponseAction.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ public override void ApplyAction(RewriteContext context, BackReferenceCollection
3131

3232
if (!string.IsNullOrEmpty(StatusDescription))
3333
{
34-
var feature = context.HttpContext.Features.Get<IHttpBodyControlFeature>();
35-
if (feature != null)
36-
{
37-
feature.AllowSynchronousIO = true;
38-
}
34+
context.HttpContext.Features.Get<IHttpBodyControlFeature>()?.AllowSynchronousIO = true;
35+
3936
var content = Encoding.UTF8.GetBytes(StatusDescription);
4037
response.ContentLength = content.Length;
4138
response.ContentType = "text/plain; charset=utf-8";

Diff for: src/Middleware/StaticFiles/src/StaticFileContext.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,7 @@ private ContentRangeHeaderValue ComputeContentRange(RangeItemHeaderValue range,
407407
// Only called when we expect to serve the body.
408408
private void SetCompressionMode()
409409
{
410-
var responseCompressionFeature = _context.Features.Get<IHttpsCompressionFeature>();
411-
if (responseCompressionFeature != null)
412-
{
413-
responseCompressionFeature.Mode = _options.HttpsCompression;
414-
}
410+
_context.Features.Get<IHttpsCompressionFeature>()?.Mode = _options.HttpsCompression;
415411
}
416412

417413
internal enum PreconditionState : byte

Diff for: src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,7 @@ protected virtual bool ValidateNode()
248248
{
249249
// If the field has an entry in ModelState, then record it as valid. Don't create
250250
// extra entries if they don't exist already.
251-
var entry = ModelState[Key];
252-
if (entry != null)
253-
{
254-
entry.ValidationState = ModelValidationState.Valid;
255-
}
256-
251+
ModelState[Key]?.ValidationState = ModelValidationState.Valid;
257252
return true;
258253
}
259254
}

Diff for: src/Mvc/Mvc.ViewFeatures/src/Filters/SaveTempDataFilter.cs

+2-11
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ public void OnResourceExecuted(ResourceExecutedContext context)
8383
// not be available.
8484
if (!context.HttpContext.Response.HasStarted && context.Exception != null)
8585
{
86-
var saveTempDataContext = GetTempDataContext(context.HttpContext);
87-
if (saveTempDataContext != null)
88-
{
89-
saveTempDataContext.RequestHasUnhandledException = true;
90-
}
86+
GetTempDataContext(context.HttpContext)?.RequestHasUnhandledException = true;
9187
}
9288
}
9389

@@ -105,12 +101,7 @@ public void OnResultExecuted(ResultExecutedContext context)
105101
if (!context.HttpContext.Response.HasStarted)
106102
{
107103
SaveTempData(context.Result, _factory, context.Filters, context.HttpContext);
108-
109-
var saveTempDataContext = GetTempDataContext(context.HttpContext);
110-
if (saveTempDataContext != null)
111-
{
112-
saveTempDataContext.TempDataSaved = true;
113-
}
104+
GetTempDataContext(context.HttpContext)?.TempDataSaved = true;
114105
}
115106
}
116107

Diff for: src/Mvc/Mvc.ViewFeatures/src/SkipStatusCodePagesAttribute.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ public void OnResourceExecuting(ResourceExecutingContext context)
2323
{
2424
ArgumentNullException.ThrowIfNull(context);
2525

26-
var statusCodeFeature = context.HttpContext.Features.Get<IStatusCodePagesFeature>();
27-
if (statusCodeFeature != null)
28-
{
29-
// Turn off the StatusCodePages feature.
30-
statusCodeFeature.Enabled = false;
31-
}
26+
// Turn off the StatusCodePages feature.
27+
context.HttpContext.Features.Get<IStatusCodePagesFeature>()?.Enabled = false;
3228
}
3329
}

Diff for: src/Security/Authentication/Negotiate/src/NegotiateHandler.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,7 @@ public async Task<bool> HandleRequestAsync()
126126
Logger.Reauthenticating();
127127
_negotiateState.Dispose();
128128
_negotiateState = null;
129-
if (persistence != null)
130-
{
131-
persistence.State = null;
132-
}
129+
persistence?.State = null;
133130
}
134131

135132
_negotiateState ??= Options.StateFactory.CreateInstance();

Diff for: src/Servers/HttpSys/src/RequestProcessing/Request.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ public long? MaxRequestBodySize
264264
set
265265
{
266266
EnsureRequestStream();
267-
if (_nativeStream != null)
268-
{
269-
_nativeStream.MaxSize = value;
270-
}
267+
_nativeStream?.MaxSize = value;
271268
}
272269
}
273270

Diff for: src/Servers/HttpSys/src/RequestProcessing/Response.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,7 @@ public TimeSpan? CacheTtl
186186
// callers if they try to add them too late. E.g. after Content-Length or CompleteAsync().
187187
internal void MakeTrailersReadOnly()
188188
{
189-
if (_trailers != null)
190-
{
191-
_trailers.IsReadOnly = true;
192-
}
189+
_trailers?.IsReadOnly = true;
193190
}
194191

195192
internal void Abort()

Diff for: src/Shared/HttpExtensions.cs

+1-5
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ internal static void ClearEndpoint(HttpContext context)
5858
context.SetEndpoint(endpoint: null);
5959
}
6060

61-
var routeValuesFeature = context.Features.Get<IRouteValuesFeature>();
62-
if (routeValuesFeature != null)
63-
{
64-
routeValuesFeature.RouteValues = null!;
65-
}
61+
context.Features.Get<IRouteValuesFeature>()?.RouteValues = null!;
6662
}
6763
}

Diff for: src/Tools/dotnet-user-jwts/src/Helpers/JwtStore.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ public JwtStore(string userSecretsId, Program program = null)
1818
Load();
1919

2020
// For testing.
21-
if (program is not null)
22-
{
23-
program.UserJwtsFilePath = _filePath;
24-
}
21+
program?.UserJwtsFilePath = _filePath;
2522
}
2623

2724
public IDictionary<string, Jwt> Jwts { get; private set; } = new Dictionary<string, Jwt>();

0 commit comments

Comments
 (0)