public async Task Set(JeepeeControlDTO dto) { // only act on the request if the allowed connection is making it if (Context.ConnectionId == ConnectionTracker.ConnectedUser) { await _mediator.Send(new UpdateChannel(dto.Channel, dto.Direction, dto.On)); await Clients.All.SendAsync("Set", dto); } }
public IActionResult Set(JeepeeControlDTO dto) { _mediator.Send(new UpdateChannel(dto.Channel, dto.Direction, dto.On)); return(Ok()); }