Lazy Properties Are Good. That Is How You Are to Use Them

TLDRIn C#9 you can write number.Triple() is { Value: > 5 } res ? res : 1 , and it is true. You have to agree that you cannot guarantee how many times this method is going to be called. You will need to cache your SomeMethod by creating an additional table of values, otherwise, it may be called multiple times.

7m read time From habr.com
Post cover image
Table of contents
Problems of parameterless methodsWhat is the solution?Down into detailsMy naive implementationA real world example?

Sort: