Changelog for Upgrade from ASP.NET Core 2.1 to ASP.NET Core 3.1
October 31, 2020 ยท View on GitHub
All notable changes to this project will be documented in this file.
Update to AspNetCore v3.1.2 (2020-03-05)
Summary
- All packages updated to the latest version.
- Code improvement and bug fixes.
- AutoMapper v9.0.0 changes applied and static
Mapperremoved. - Swashbuckle new changes applied.
- NETCore 3.x and ASPNETCore 3.x and EFCore 3.x new changes applied.
Details
-
Because of updates in
AutoMapperapi and removing the staticMapperclass,IMapperpassed to all controller and services that uses mapping. (for example OldPostsController.cs) -
Mapping implementation changed in BaseDto.cs
-
Mapping configuration changed in AutoMapperConfiguration.cs
-
Package
Microsoft.EntityFrameworkCore.Toolsadded. We need it since EFCore v3.x to use migration command in Nuget Package Manager Console. -
Because of EFCore3.x api changes,
entityType.Relational().TableNamechanged toentityType.GetTableName()andproperty.Relational().DefaultValueSqlchanged toproperty.SetDefaultValueSql()in ModelBuilderExtensions.cs -
ConfigureWarningsremoved in ServiceCollectionExtensions.cs because automatic client evaluation is no longer supported and this event is no longer generated. -
ValueTaskreplaced byTaskinGetByIdAsyncmethod of Repository -
Package
Swashbuckle.AspNetCore.Examplesreplaced bySwashbuckle.AspNetCore.Filtersand so their namespaces. -
IExamplesProviderchanged to generic versionIExamplesProvider<T>(see CreateUserResponseExample) -
Package
NLog.Targets.Sentry2replaced bySentry.NLogand their related code changed in Program.cs and its nlog.config changed a little. -
Due to model changes in OpenApi(Swagger), these files changed ApplySummariesOperationFilter.cs, RemoveVersionParameters.cs, SetVersionInPaths.cs, UnauthorizedResponsesOperationFilter.cs
-
Swagger configuration in SwaggerConfigurationExtensions.cs changed due to swagger new updates
-
Implementation of ApiResultFilterAttribute.cs changed due to ASPNETCore 3.x new updates
-
Implementation of
AddMinimalMvcin ServiceCollectionExtensions.cs method changed sinceservice.AddControllers()was introduced. -
IHostingEnvironmentreplaced byIWebHostEnvironmentbecause of API deprecated in NETCore 3.x (here for example) -
The
app.UseMvc()replaced byapp.UseRouting()andapp.UseEndpoints()in Startup.Configure method -
Unused namespaces in all projects removed.