You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -117,27 +117,35 @@ For apps using Docker, update your *Dockerfile* `FROM` statements and scripts. U
117
117
118
118
As part of the move to ".NET" as the product name, the Docker images moved from the `mcr.microsoft.com/dotnet/core` repositories to `mcr.microsoft.com/dotnet`. For more information, see [dotnet/dotnet-docker#1939](https://github.com/dotnet/dotnet-docker/issues/1939).
119
119
120
-
## Review breaking changes
121
-
122
-
For breaking changes from .NET Core 3.1 to .NET 5.0, see [Breaking changes for migration from version 3.1 to 5.0](/dotnet/core/compatibility/3.1-5.0). ASP.NET Core and Entity Framework Core are also included in the list.
123
-
124
-
## Changes to model binding in ASP.NET Core MVC and Razor Pages
120
+
## Model binding changes in ASP.NET Core MVC and Razor Pages
125
121
126
122
### DateTime values are model bound as UTC times
127
123
128
-
In ASP.NET Core 3.1 and earlier, `DateTime` values were model bound as local time where the timezone was determined by the server. `DateTime` values bound from input formatting (JSON) and `DateTimeOffset` values were bound as UTC timezones. In ASP.NET Core 5.0 and later, model binding consistently binds `DateTime` values with the UTC timezone.
124
+
In ASP.NET Core 3.1 and earlier, `DateTime` values were model-bound as local time, where the timezone was determined by the server. `DateTime` values bound from input formatting (JSON) and `DateTimeOffset` values were bound as UTC timezones.
125
+
126
+
In ASP.NET Core 5.0 and later, model binding consistently binds `DateTime` values with the UTC timezone.
129
127
130
-
To retain the previous behavior, remove the `DateTimeModelBinderProvider`as part of the application startup:
128
+
To retain the previous behavior, remove the `DateTimeModelBinderProvider`in `Startup.ConfigureServices`:
To add support for model binding [C# 9 record types](/dotnet/csharp/whats-new/csharp-9#record-types), the <xref:Microsoft.AspNetCore.Mvc.ModelBinding.Binders.ComplexTypeModelBinderProvider> is:
137
138
138
-
As part of adding support for model binding record types, the `ComplexTypeModelBinderProvider` is annotated as obsolete and is no longer registered by default. Applications that previously relied on the presence of the `ComplexTypeModelBinderProvider` in the `ModelBinderProviders` collection need to be updated to reference the new binder provider:
139
+
* Annotated as obsolete.
140
+
* No longer registered by default.
141
+
142
+
Apps that rely on the presence of the `ComplexTypeModelBinderProvider` in the `ModelBinderProviders` collection need to reference the new binder provider:
139
143
140
144
```diff
141
145
- var complexModelBinderProvider = options.ModelBinderProviders.OfType<ComplexTypeModelBinderProvider>();
142
146
+ var complexModelBinderProvider = options.ModelBinderProviders.OfType<ComplexObjectModelBinderProvider>();
143
147
```
148
+
149
+
## Review breaking changes
150
+
151
+
For breaking changes from .NET Core 3.1 to .NET 5.0, see [Breaking changes for migration from version 3.1 to 5.0](/dotnet/core/compatibility/3.1-5.0). ASP.NET Core and Entity Framework Core are also included in the list.
0 commit comments