KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In the following code: public class SomeClass { // ... constructor and other stuff public in SomeProperty { get { return SomeHeavyCalculation(); } } } I consider the class to be immutable, so every time SomeProperty is accessed, same value should be returned. My question is whether it is possible to avoid calculating the value each time. Is there some built in mechanism for caching such stuff?
Tags (comma-separated)
Save Edits
Cancel