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 <[email protected]>
1 parent 4fc6e31 commit 72fd6dd

File tree

15 files changed

+22
-83
lines changed

15 files changed

+22
-83
lines changed

global.json

Lines changed: 2 additions & 2 deletions
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)"

src/Components/Server/src/Circuits/CircuitHost.cs

Lines changed: 1 addition & 4 deletions
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.

src/Hosting/Hosting/src/Http/DefaultHttpContextFactory.cs

Lines changed: 3 additions & 12 deletions
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
}

src/Http/Http/src/HttpContextAccessor.cs

Lines changed: 2 additions & 6 deletions
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
{

src/Middleware/Rewrite/src/RewriteMiddleware.cs

Lines changed: 1 addition & 5 deletions
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
}

src/Middleware/Rewrite/src/UrlActions/CustomResponseAction.cs

Lines changed: 2 additions & 5 deletions
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";

src/Middleware/StaticFiles/src/StaticFileContext.cs

Lines changed: 1 addition & 5 deletions
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

src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs

Lines changed: 1 addition & 6 deletions
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
}

src/Mvc/Mvc.ViewFeatures/src/Filters/SaveTempDataFilter.cs

Lines changed: 2 additions & 11 deletions
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

src/Mvc/Mvc.ViewFeatures/src/SkipStatusCodePagesAttribute.cs

Lines changed: 2 additions & 6 deletions
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
}

0 commit comments

Comments
 (0)