コード例 #1
0
        public async Task AddPackage(Uri packageUrl)
        {
            var callbacks = _triggerRepository.GetTriggerCallbacks();

            var triggerBody = new TriggerBody {
                PackageUrl = packageUrl.ToString()
            };

            foreach (var callback in callbacks)
            {
                try
                {
                    await callback.InvokeAsync(
                        Runtime.FromAppSettings(),
                        triggerBody);
                }
                catch (HttpRequestException e)
                {
                    // Server Unavailable
                    Log.Write(() => e);
                }
                catch (InvalidOperationException e)
                {
                    // Bad Request
                    Log.Write(() => e);
                }
            }
        }