Update Hub to .NET 8 and all OpenTelemetry

This commit is contained in:
2024-01-27 16:25:14 -05:00
parent d8fd6d13f9
commit 9cddb80f00
12 changed files with 78 additions and 125 deletions

View File

@@ -1,17 +1,17 @@
using JetBrains.Annotations;
using Microsoft.AspNetCore.SignalR;
using System;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace ChrisKaczor.HomeMonitor.Hub.Service.Hubs
{
[UsedImplicitly]
public class WeatherHub : Microsoft.AspNetCore.SignalR.Hub
public class WeatherHub(ILogger<WeatherHub> logger) : Microsoft.AspNetCore.SignalR.Hub
{
[UsedImplicitly]
public async Task SendLatestReading(string message)
{
Console.WriteLine(message);
logger.LogInformation(message);
await Clients.Others.SendAsync("LatestReading", message);
}