Skip to content

Commit

Permalink
Update Post.md
Browse files Browse the repository at this point in the history
  • Loading branch information
EngincanV authored Oct 3, 2024
1 parent b6e065c commit cb3e904
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In this article, I’ll highlight the latest .**NET 9 SignalR updates** for ASP.

SignalR `Hub` class can now get a base class of a polymorphic class. As you see in the example below, I can send `Animal` to `Process` method. Before .NET 9, we could only pass the derived classes: `Cat` and `Dog`.

```
```csharp
/*** My Base Class is Animal ***/
[JsonPolymorphic]
[JsonDerivedType(typeof(Cat), nameof(Cat))]
Expand Down Expand Up @@ -53,15 +53,15 @@ Microsoft focuses mainly on .NET Aspire nowadays. That’s why SignalR now integ

1- Add these packages to your`csproj`:

```
```xml
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
```

2- Add the following startup code to your host project:

```
```csharp
builder.Services.AddSignalR();
/* After AddSignalR use AddOpenTelemetry() */
builder
Expand Down

0 comments on commit cb3e904

Please sign in to comment.