示例#1
0
        private Registrations.EFStorage.WebHookNotification AddNotification(TestContext1 context, Guid id, string trigger)
        {
            var result = new Registrations.EFStorage.WebHookNotification
            {
                Id        = id,
                TriggerId = trigger,
                Payload   = new List <int> {
                    1, 2
                }
            };

            context.Add(result);
            return(result);
        }
        /// <inheritdoc />
        protected override async Task <Guid> LogAsync(IWebHookNotification notification, IReadOnlyList <IWebHook> webHooks, CancellationToken cancellationToken)
        {
            var notif = new Registrations.EFStorage.WebHookNotification
            {
                Payload   = notification.Payload,
                TriggerId = notification.TriggerId,
                Count     = webHooks.Count
            };

            _context.Add(notif);

            await _context.SaveChangesAsync();

            return(notif.Id);
        }