PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.LazyWithContext< TContext, TValue > Class Template Reference

More...

Inheritance diagram for PeanutButter.Utils.LazyWithContext< TContext, TValue >:
PeanutButter.Utils.ILazyWithContext< TValue >

Public Member Functions

 LazyWithContext (TContext context, Func< TContext, TValue > valueFactory)
 Synchronous Lazy constructor.
 LazyWithContext (TContext context, Func< TContext, Task< TValue > > valueFactory)
 Asynchronous Lazy constructor.

Properties

TValue Value [get]
 The lazily-evaluated value.

Detailed Description

Member Function Documentation

◆ LazyWithContext() [1/2]

PeanutButter.Utils.LazyWithContext< TContext, TValue >.LazyWithContext ( TContext context,
Func< TContext, Task< TValue > > valueFactory )

Asynchronous Lazy constructor.

Parameters
contexthost provider (for this context)
valueFactorymethod to run to get the value

◆ LazyWithContext() [2/2]

PeanutButter.Utils.LazyWithContext< TContext, TValue >.LazyWithContext ( TContext context,
Func< TContext, TValue > valueFactory )

Synchronous Lazy constructor.

Parameters
contexthost provider (for this context)
valueFactorymethod to run to get the value

Property Documentation

◆ Value

TValue PeanutButter.Utils.LazyWithContext< TContext, TValue >.Value
get

The lazily-evaluated value.

Implements PeanutButter.Utils.ILazyWithContext< TValue >.


The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/LazyWithContext.cs