Question on making a “cache” to only be read once?


So I have a result I only want to verify once, and only when the request is made, and then be able to use the value later often.

To do so I was thinking something like this(rough example, hope it gets my goal across):

Then setting up the fields in the constructors and the reads for the set up fields in the classes.

My question is, is there anything wrong with that example? I'm kind of new to coding as can be seen by some of my post, but I'm just wanting to see if anyone else has any suggestions here before writing the classes this week. Thanks.

by JacobKemple via /r/csharp

Leave a Reply