28 lines
976 B
C#
28 lines
976 B
C#
// using MediatR;
|
|
// using Sledgemapper.Api.Infrastructure.Data;
|
|
// using System.Threading;
|
|
// using System.Threading.Tasks;
|
|
// using Sledgemapper.Api.Notifications;
|
|
// using System.Linq;
|
|
|
|
// namespace Sledgemapper.Api.Commands
|
|
// {
|
|
// public class PingCommandHandler : IRequestHandler<PingCommand, bool>
|
|
// {
|
|
// private readonly SledgemapperDbContext _dbcontext;
|
|
// private readonly IMediator _mediator;
|
|
|
|
// public PingCommandHandler(IMediator mediator, SledgemapperDbContext dbcontext) { _dbcontext = dbcontext; _mediator = mediator; }
|
|
|
|
// public async Task<bool> Handle(PingCommand notification, CancellationToken cancellationToken)
|
|
// {
|
|
// var session = _dbcontext.Sessions.First(m => m.SessionName == notification.SessionName);
|
|
|
|
|
|
// await _mediator.Publish(new PingNotification(session, notification.Location, notification.UserId));
|
|
// return true;
|
|
// }
|
|
|
|
|
|
// }
|
|
// }
|