public IActionResult GetRecord(long id) { _logger.LogInformation($"{nameof(RecordController)} : {nameof(GetRecord)} was called."); try { var record = _recordService.FindById(id); if (record == null) { return(NotFound("Record Not Found")); } return(Ok(record)); } catch (DbException exception) { _logger.LogError(exception.Message); return(BadRequest(exception.Message)); } catch (Exception exception) { _logger.LogError(exception.Message); throw; } }
public async Task <RecordDTO> Get(int id) { return(await _recordService.FindById(id)); }