// GET api/PushRegistration
        public async Task Post([FromBody] DeviceInstallationInfo deviceInstallInfo)
        {
            bool isChanged    = false;
            var  ctx          = new MobileServiceContext();
            var  registration = ctx.DeviceRegistrations.Where(x => x.InstallationId == deviceInstallInfo.InstallationId);

            if (registration.Count() == 0)
            {
                NotificationPlatform?plat = await GetNotificationPlatform(deviceInstallInfo.InstallationId);

                if (null != plat)
                {
                    var newRegistration = new Common.Models.DeviceRegistration()
                    {
                        Id             = Guid.NewGuid().ToString(),
                        InstallationId = deviceInstallInfo.InstallationId,
                        UserId         = deviceInstallInfo.UserId,
                        Platform       = plat.Value
                    };

                    ctx.DeviceRegistrations.Add(newRegistration);
                    isChanged = true;
                }
            }
            else
            {
                var reg = registration.First();

                if (reg.UserId != deviceInstallInfo.UserId)
                {
                    reg.UserId = deviceInstallInfo.UserId;
                    isChanged  = true;
                }
            }

            try
            {
                if (isChanged)
                {
                    ctx.SaveChanges();
                }
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }
        // GET api/PushRegistration
        public async Task Post([FromBody] DeviceInstallationInfo deviceInstallInfo)
        {
            bool isChanged = false;
            var ctx = new MobileServiceContext();
            var registration = ctx.DeviceRegistrations.Where(x => x.InstallationId == deviceInstallInfo.InstallationId);

            if (registration.Count() == 0)
            {
                NotificationPlatform? plat = await GetNotificationPlatform(deviceInstallInfo.InstallationId);

                if (null != plat)
                {
                    var newRegistration = new Common.Models.DeviceRegistration() {
                        Id = Guid.NewGuid().ToString(),
                                                                                         InstallationId = deviceInstallInfo.InstallationId,
                                                                                         UserId = deviceInstallInfo.UserId,
                        Platform = plat.Value
                    };

                    ctx.DeviceRegistrations.Add(newRegistration);
                    isChanged = true;
                }
            }
            else
            {
                var reg = registration.First();

                if (reg.UserId != deviceInstallInfo.UserId)
                {
                    reg.UserId = deviceInstallInfo.UserId;
                    isChanged = true;
                }
            }

            try
            {
                if (isChanged)
                    ctx.SaveChanges();
            }
            catch (System.Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }