// POST: api/Like
        public async Task<bool> Post([FromBody]Dictionary<string,string> image)
        {
            var logic = new ImageBusinessLogic();

            var img = logic.GetImage(image["imageId"]);
            if (null != img)
            {
                var ctx = new MobileServiceContext();
                var registrations = ctx.DeviceRegistrations.Where(x => x.UserId == img.UserId);

                //Send x-plat template message to all installations in tags list
                //List<string> tags = new List<string>();
                //foreach (var registration in registrations)
                //    tags.Add(string.Format("$InstallationId:{{{0}}}", registration.InstallationId));

                //if (tags.Count > 0)
                //{
                //    var message = new Dictionary<string, string>()
                //    {
                //        { "message", string.Format("{0} has liked your image", img.User.Email)}
                //    };
                //    var res = await Notifier.Instance.SendTemplateNotification(message, tags);

                //    return res;
                //}
                //else
                //    return true;

                //Send plat-specific message to all installation one by one
                string message = string.Format("{0} has liked your image", img.User.Email);
                foreach (var registration in registrations)
                {
                    var tags = new string[1] { string.Format("$InstallationId:{{{0}}}", registration.InstallationId) };
                    switch (registration.Platform)
                    {
                        case NotificationPlatform.Wns:
                            await Notifier.Instance.sendWindowsStoreNotification(message, tags);
                            break;
                        case NotificationPlatform.Apns:
                            await Notifier.Instance.sendIOSNotification(message, tags);
                            break;
                        case NotificationPlatform.Mpns:
                            await Notifier.Instance.sendWPNotification(message, tags);
                            break;
                        case NotificationPlatform.Gcm:
                            await Notifier.Instance.sendGCMNotification(message, tags);
                            break;
                        case NotificationPlatform.Adm:
                            //NOT SUPPORTED
                            break;
                        default:
                            break;
                    }
                }
            }

            return true;
        }
        public async Task<CommitBlobResponse> Post([FromBody]CommitBlobRequest commitBlobRequest)
        {
            var res = new CommitBlobResponse();
            var cs = new ContosoStorage();
            string fileExt = BlobInformation.DEFAULT_FILE_EXT;

            //if (!commitBlobRequest.IsMobile)
            //{

                fileExt = cs.CommitUpload(commitBlobRequest);
            //}
            var url = commitBlobRequest.SasUrl.Replace(AppSettings.StorageWebUri, "");
            var urldata = url.Split('?');
            var index = urldata[0].IndexOf('/');

            var content = urldata[0].Split('/');


            var containerName = urldata[0].Substring(0, index);
            //  var fileName = urldata[0].Replace(containerName + "/", "");
            string fileGuidName = urldata[0].Replace(containerName + "/lg/", "").Replace(".temp", "");

            
            var ibl = new ImageBusinessLogic();
            var image = ibl.AddImageToDB(commitBlobRequest.AlbumId, commitBlobRequest.UserId, containerName, fileGuidName + "." + fileExt, commitBlobRequest.IsMobile);
            if (image != null)
            {
                res.Success = true;
                res.ImageId = image.Id;                                                                                                                                                                                                                            
            }
            var qm = new QueueManager();
            var blobInfo = new BlobInformation(fileExt);
            blobInfo.BlobUri = cs.GetBlobUri(containerName, urldata[0].Replace(containerName, ""));
            // blobInfo.FileGuidName = fileGuidName;
            blobInfo.ImageId = fileGuidName;
            await qm.PushToResizeQueue(blobInfo);
            return res;

        }