Notes/NoteHub.cs

23 lines
489 B
C#
Raw Normal View History

2023-01-25 13:48:50 +00:00
using BinaryDad.Notes.Services;
using Microsoft.AspNetCore.SignalR;
namespace BinaryDad.Notes
{
public class NoteHub : Hub
{
private readonly INoteService noteService;
public NoteHub(INoteService noteService)
{
this.noteService = noteService;
}
public async Task SaveNote(string content)
{
noteService.Save(content);
await Clients.Others.SendAsync("updateNote", content);
}
}
}