I'm having trouble initializing properties within a class using the method described in this documentation.
Sample:
public class MyClass
{
private Lazy<string> _lazyString;
public MyClass()
{
_lazyString = new Lazy<string>(() => "hello world");
}
public string MyString => _lazyString.Value;
}
When I debug I can see that _lazyString has its boolean IsCreated set to true before I've even accessed the MyString property. Has something changed in the recent c# iterations?
My target framework is netcoreapp3.1