Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs =================================================================== diff -u -r4e4ced94d27f939fc77f364201840814dc542af1 -r24145cb7feea063e2986e8f4b2270bb2a478b3fd --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs (.../StochasticSoilProfileReader.cs) (revision 4e4ced94d27f939fc77f364201840814dc542af1) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/StochasticSoilProfileReader.cs (.../StochasticSoilProfileReader.cs) (revision 24145cb7feea063e2986e8f4b2270bb2a478b3fd) @@ -98,7 +98,7 @@ { if (exception is FormatException || exception is OverflowException || exception is InvalidCastException) { - var message = new FileReaderErrorMessageBuilder(Path) + string message = new FileReaderErrorMessageBuilder(Path) .Build(Resources.StochasticSoilProfileDatabaseReader_StochasticSoilProfile_has_invalid_value); throw new StochasticSoilProfileReadException(message, exception); } @@ -108,10 +108,7 @@ public override void Dispose() { - if (dataReader != null) - { - dataReader.Dispose(); - } + dataReader?.Dispose(); base.Dispose(); } @@ -137,15 +134,15 @@ private void CreateDataReader() { - var stochasticSoilProfileQuery = SoilDatabaseQueryBuilder.GetAllStochasticSoilProfileQuery(); + string stochasticSoilProfileQuery = SoilDatabaseQueryBuilder.GetAllStochasticSoilProfileQuery(); try { dataReader = CreateDataReader(stochasticSoilProfileQuery); } catch (SQLiteException exception) { CloseConnection(); - var message = new FileReaderErrorMessageBuilder(Path) + string message = new FileReaderErrorMessageBuilder(Path) .Build(Resources.StochasticSoilModelDatabaseReader_Failed_to_read_database); throw new CriticalFileReadException(message, exception); }