Here's a summary of what's new in ASP.NET Core in this preview release:
- Dictionary debugging improvements
- JSON polymorphic type support in SignalR Hubs
- General quality improvements and bug fixes
ASP.NET Core updates in .NET 9 Preview 1:
- Discussion
- What's new in ASP.NET Core in .NET 9 documentation.
- Breaking changes
- Roadmap
.NET 9 Preview 1:
The debugging display of dictionaries and other key-value collections has an improved layout. The key is displayed in the debugger's key column instead of being concatenated with the value. The following images show the old and new display of a dictionary in the debugger.
Before:
After:
ASP.NET Core has many key-value collections. This improved debugging experience applies to:
- HTTP headers
- Query strings
- Forms
- Cookies
- View data
- Route data
- Features
Hub methods can now accept a base class instead of the derived class to enable polymorphic scenarios. The base type needs to be annotated to allow polymorphism.
public class MyHub : Hub
{
public void Method(JsonPerson person)
{
if (person is JsonPersonExtended)
{
}
else if (person is JsonPersonExtended2)
{
}
else
{
}
}
}
[JsonPolymorphic]
[JsonDerivedType(typeof(JsonPersonExtended), nameof(JsonPersonExtended))]
[JsonDerivedType(typeof(JsonPersonExtended2), nameof(JsonPersonExtended2))]
private class JsonPerson
{
public string Name { get; set; }
public Person Child { get; set; }
public Person Parent { get; set; }
}
private class JsonPersonExtended : JsonPerson
{
public int Age { get; set; }
}
private class JsonPersonExtended2 : JsonPerson
{
public string Location { get; set; }
}
Thank you contributors! ❤️
- @abc516
- @afshinm
- @aleksvujic
- @alexbeeston
- @alex-inftx
- @aligoren
- @alrz
- @bfriesen
- @brianrourkeboll
- @BurkusCat
- @campersau
- @charytech
- @CollinAlpert
- @cremor
- @damirault
- @DanielCordell
- @davhdavh
- @david-acker
- @DavidKlempfner
- @GeorgiPopovIT
- @gfoidl
- @glen-84
- @GreyFogSamurai
- @HavenDV
- @Issung
- @jirikanda
- @joegoldman2
- @Kahbazi
- @kaotoby
- @kirides
- @KonH
- @ladeak
- @lofcz
- @MaceWindu
- @mariusz96
- @naeemaei
- @onurkanbakirci
- @paulomorgado
- @pentp
- @rameel
- @RyanGaudion
- @simon-curtis
- @tmds
- @vanillajonathan
- @vhatuncev
- @viliml
- @Vishwanatha-HD
- @WeihanLi
- @Who-Code
- @xaberue
- @zcxsythenew
- @zorix