DailyLogBeam? dailyLogInfo = null; try { dailyLogInfo = await _db.GetOne<DailyLogBeam, dynamic, SqlConnection>(sql, new { shift = shift.StartTime }, "Meltcast"); } catch (Exception ex) { _logger.LogError(ex, "Failed to fetch log info!"); } if (dailyLogInfo is null) { //initializing empty db result } // Continued execution with db results