예제 #1
0
        public async Task <IActionResult> Logger([FromBody] LoggerDTOs loggerDTOs)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            await _loggerService.InsertIntoLog(loggerDTOs);

            return(Ok());
        }
예제 #2
0
        public async Task <bool> InsertIntoLog(LoggerDTOs loggerDTOs)
        {
            var createLog = new Logger
            {
                Exception = loggerDTOs.Exception,
                Message   = loggerDTOs.Message,
                Level     = loggerDTOs.Level,
                Date      = loggerDTOs.Date
            };
            await _loggerRepository.InsertIntoLog(createLog);

            return(true);
        }