Переместил ChatHub в слой Application

This commit is contained in:
2026-08-29 17:08:44 +03:00
parent 0bea967bcf
commit d141969e45
6 changed files with 25 additions and 3 deletions
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../AMessanger.Core/AMessanger.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR" />
</ItemGroup>
</Project>
+14
View File
@@ -0,0 +1,14 @@
using AMessanger.Core.Models;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging;
namespace AMessanger.Application.Hubs;
public class ChatHub(ILogger<ChatHub> logger) : Hub
{
public async Task SendMessage(Message message)
{
logger.LogInformation($"{message.UserName}: {message.Content}");
await Clients.All.SendAsync("ReceiveMessage", message);
}
}