using Bootstrap.DataAccess;
using Microsoft.AspNetCore.SignalR;
using System;
using System.Data.Common;
namespace Bootstrap.Admin
{
///
///
///
public static class SignalRManager
{
///
///
///
///
///
///
public static async System.Threading.Tasks.Task Send(IClientProxy client, MessageBody args) => await client.SendAsync("rev", args);
///
///
///
///
///
///
public static async System.Threading.Tasks.Task Send(IHubContext context, Exception ex) where T : Hub
{
var category = "App";
if (ex.GetType().IsSubclassOf(typeof(DbException))) category = "DB";
var message = new MessageBody() { Category = category, Message = ex.Message };
await Send(context.Clients.All, message);
}
}
}