Exemplo n.º 1
0
        /// <summary>
        /// Audits your DTO asynchronously.
        /// </summary>
        /// <param name="auditRequest">The audit request.</param>
        /// <returns></returns>
        public async Task AuditAsync(AuditRequest auditRequest)
        {
            var auditEvent = auditRequest.AsAuditEvent();

            AuditConfiguration.Current.ApplyTo(auditEvent);
            auditEvent.EnsureValid();

            var url = $"{this.serviceBase}/api/{AuditAsyncRoute}";

            await this.httpClient.PostAsJsonAsync(url, auditEvent);
        }
Exemplo n.º 2
0
        public async Task AuditAsync(AuditRequest auditRequest)
        {
            var auditEvent = auditRequest.AsAuditEvent();

            AuditConfiguration.Current.ApplyTo(auditEvent);
            auditEvent.EnsureValid();

            var payload = JsonConvert.SerializeObject(auditEvent);
            var message = new BrokeredMessage(payload);

            await this.topicClient.SendAsync(message);
        }