Exemple #1
0
        public async Task <Guid> SaveAuditAsync(string identifier, string message, string detail, LogSourceEnum source, LogTypeEnum type)
        {
            var model = new LogAuditoria(identifier, message, detail, source, type);
            await _logAudit.AddAsync(model);

            return(model.Id);
        }
Exemple #2
0
        protected override async Task CustomSeedAsync()
        {
            #region Inicia Logs
            var logs = new List <LogModel>()
            {
                new LogModel()
                {
                    Version     = "1.0",
                    Method      = "CustomSeedAsync",
                    DateTime    = DateTime.Now,
                    Detail      = "Base de Logs Inicializada",
                    Application = "LT.SO"
                }
            };

            await Task.WhenAll(logs.Select(l =>
                                           _logRepo.AddAsync(l)));

            #endregion

            #region Inicia LogsAuditoria
            var logsAuditoria = new List <LogAuditoria>()
            {
                new LogAuditoria("", "Base de Logs de Auditoria Inicializada", "", CrossCutting.Log.Enum.LogSourceEnum.Infra_Data, CrossCutting.Log.Enum.LogTypeEnum.Performance)
            };

            await Task.WhenAll(logsAuditoria.Select(a =>
                                                    _logAuditRepo.AddAsync(a)));

            #endregion
        }