I have a simple struct which contains two fields; one stores an object and the other stores a DateTime. I did this because I wanted to store objects in a Dictionary but with a DateTime stamp as well.
I’ve got a method which returns my structure, and I’ve now decided the method should also be able to return null, so I made my structure nullable. I’m now wondering if I should just make my structure a class so it’s a reference type?
In this case, yes, it’s probably clearer to make your structure a class.
As far as justification goes, you’re essentially creating a specialized
Tuple. It’s interesting to note that the library designers have opted to make the .Net 4Tuplea class rather than a struct. (That page is the tuple creator and links to the various tuple instance classes)