Beispiel #1
0
        public async Task InvokeAsync(HttpContext context, IRequestService reqService)
        {
            var client = await ClientIdentityHelper.ResolveIdentityAsync(context, _options);

            RequestLogRecord record = new RequestLogRecord
            {
                ClientId  = client.ClientId,
                Timestamp = DateTime.UtcNow
            };

            await reqService.StoreRequest(record);

            // Call the next delegate/middleware in the pipeline
            await _next(context);
        }
        public async Task StoreRequest(RequestLogRecord record)
        {
            await _requestLogRepository.Create(record);

            return;
        }
 public Task Create(RequestLogRecord record)
 {
     return(Task.Run(() => {
         _records.Add(record);
     }));
 }