Class LazyGetAndLog<TValue>
A LazyGet<TValue> with logging.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class LazyGetAndLog<TValue>
Type Parameters
TValue
- Inheritance
-
objectLazyGetAndLog<TValue>
Fields
Value
protected TValue? Value
Field Value
- TValue
Properties
IsValueCreated
Determines if value has been created.
The name IsValueCreated is the same as in a Lazy() object
public bool IsValueCreated { get; protected set; }
Property Value
Methods
Get(ILog, Func<TValue>, bool, bool, string?, string?, string?, string?, int)
Getter with will log its actions when it retrieves the property the first time.
public TValue? Get(ILog log, Func<TValue> generator, bool timer = false, bool enabled = true, string? parameters = null, string? message = null, string? cPath = null, string? cName = null, int cLine = 0)
Parameters
logILogLog object to use when logging
generatorFunc<TValue>Function which will generate the value on first use. The function must return the expected value/type.
timerboolenable a timer from call/close
enabledboolcan be set to false if you want to disable logging
parametersstringmessagestringcPathstringauto pre-filled by the compiler - the path to the code file
cNamestringauto pre-filled by the compiler - the method name
cLineintauto pre-filled by the compiler - the code line
Returns
- TValue