SteveWinward / GoogleSheetsWrapper

Google Sheets API .NET Wrapper Library
MIT License
48 stars 13 forks source link

Modify GetRows() and GetRowsFormatted() to return nullable IList #25

Closed HughMacdonald closed 12 months ago

HughMacdonald commented 12 months ago

Fixes #24

SteveWinward commented 12 months ago

@HughMacdonald thank you for finding this issue and helping fix it. One concern I have is if we change the signature to a nullable return type, does that break people already using this method expecting a non nullable return? If so, would it be better to check inside the method if the result is null and then return an empty list collection with zero elements to avoid a null return?

HughMacdonald commented 12 months ago

The trouble is that it can return null already, and does if there isn't any data, but doesn't tell the user that. So people may have done what I've done and specified that the variable it's being set in is nullable. Otherwise you may end up with a variable that isn't considered nullable that still has a null value

SteveWinward commented 12 months ago

Understood. Thank you for sharing your perspective. Will accept the PR and update the version number so a new nuget version is released. I’ll reply to the thread when the new version is released.

SteveWinward commented 12 months ago

@HughMacdonald just released version 1.0.55