public async Task<bool> Post(ImageBlob imageBlob)
        {
            if (imageBlob == null || imageBlob.CanvasData == null)
                return false;

            // add the blob to blob storage/table storage
            var storedImageBlob = await imageBlobRepository.AddBlob(imageBlob);
            if (storedImageBlob != null)
            {
                BlobHub.SendFromWebApi(storedImageBlob);
            }
            return false;
        }
Exemple #2
0
 public void Send(ImageBlob latestBlob)
 {
     Clients.All.latestBlobMessage(latestBlob);
 }
Exemple #3
0
 //Called from Web Api controller, so must use GlobalHost context resolution
 public static void SendFromWebApi(ImageBlob imageBlob)
 {
     var hubContext = GlobalHost.ConnectionManager.GetHubContext<BlobHub>();
     hubContext.Clients.All.latestBlobMessage(imageBlob);
 }