I recently started on a contract role.
The idea is to take full ownership of a bunch of applications. Since there is virtually no technical documentation I've been going through the code, and adding trace logging (with NLog) where it seems appropriate.
A lot of the code however consists of the execution of stored procs and simply passing through dataset objects, like this:
- Factory.GetArchiveDataAccess().NothandledUpdate(AppSetting.StatusArchive.StatusNotHandled.GetHashCode(), Machine.DecConfigId);
-
- NewArchives.NewArchivesDataSet = Factory.GetArchiveDataAccess().NewArchives().ResultSet;
-
-
- if (NewArchives.NewArchivesDataSet != null && NewArchives.NewArchivesDataSet.Tables.Count > 0)
- {
- _logger.Trace($"Returns {NewArchives.NewArchivesDataSet.Tables[0].Rows.Count}");
- }
- else
- {
- _logger.Trace("NewArchives.NewArchivesDataSet does not contain data");
- }
At the moment, when I want to show if a strored proc found data or not I'm forced to add a bunch of tests to avoid exceptions.
Isn't there a cleaner way of achieving this?