You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a source generator that will make it quicker to define a lazily-instantiable property value. The underlying mechanism may use the provided System.Lazy<T> type. The generator may also support the partial properties feature introduced in C# 13.
This will be an alternative option to Lombok.NET's Lazy generator. The reason being that Lombok forces an irregular structure, instantiating a class instance to hold the value and refer to its instance holding the globally initialized lazy value. It's also less flexible, not conveniently supporting per-instance lazy instances out of the box.
publicclassC{[Lazy(nameof(CalculateHeavyName))]publicpartialstringHeavyName{get;}// assume heavy calculation hereprivatestringCalculateHeavyName()=>string.Empty;}
Breaking change?
No
Alternatives
As listed above, Lombok.NET offers a source generator for generating lazily-calculated instances. To avoid conflicts with Lombok's Lazy, we could provide an alternative name to the attribute.
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
The text was updated successfully, but these errors were encountered:
Overview
Provide a source generator that will make it quicker to define a lazily-instantiable property value. The underlying mechanism may use the provided
System.Lazy<T>
type. The generator may also support the partial properties feature introduced in C# 13.This will be an alternative option to Lombok.NET's
Lazy
generator. The reason being that Lombok forces an irregular structure, instantiating a class instance to hold the value and refer to its instance holding the globally initialized lazy value. It's also less flexible, not conveniently supporting per-instance lazy instances out of the box.API breakdown
Usage example
Breaking change?
No
Alternatives
As listed above, Lombok.NET offers a source generator for generating lazily-calculated instances. To avoid conflicts with Lombok's
Lazy
, we could provide an alternative name to the attribute.Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
The text was updated successfully, but these errors were encountered: