Exemplo n.º 1
0
        public async Task <AuditTrail> AddAuditTrailAsync(AuditPostModel model)
        {
            var addedTrail = await _auditRepository.AddAuditTrailAsync(new AuditTrail
            {
                Id           = Guid.NewGuid(),
                Occurred     = DateTime.Now,
                Method       = model.Method,
                Endpoint     = model.Endpoint,
                Request      = model.Request?.SerializeCamelCase(),
                IsSuccessful = model.IsSuccessful,
                StatusCode   = model.StatusCode
            });

            await _auditRepository.SaveAsync();

            return(addedTrail);
        }