Skip to content

Instantly share code, notes, and snippets.

@Maarten88
Last active December 18, 2015 04:58
Show Gist options
  • Save Maarten88/5728939 to your computer and use it in GitHub Desktop.
Save Maarten88/5728939 to your computer and use it in GitHub Desktop.
using Auction.Service.Contracts;
using Auction.Web.Domain;
using Auction.Web.Domain.Events;
using AutoMapper;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Infrastructure;
namespace Auction.Web.Hubs.EventHandlers
{
public class PriceUpdatedHandler : BaseEventHandler<PriceUpdatedEvent>
{
public override void Handle(PriceUpdatedEvent ev)
{
var priceUpdateMessage = Mapper.Map<ClientLotUpdate>(ev);
IConnectionManager connections = GlobalHost.DependencyResolver.GetService(typeof(IConnectionManager)) as IConnectionManager;
connections.GetHubContext<AuctionHub>().Clients.All.auctionUpdated(priceUpdateMessage);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment