Class LazyRelay
Relays a request for an System.Func<TResult> to a request for a System.Lazy`1 and returns the result.
Inheritance
System.Object
LazyRelay
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AutoFixture
Assembly: AutoFixture.dll
Syntax
public class LazyRelay : ISpecimenBuilder
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new specimen based on a request.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | A context that can be used to create other specimens. |
Returns
Type | Description |
---|---|
System.Object | An instance of a System.Lazy`1 if possible; otherwise a NoSpecimen instance. |
Remarks
If request
is a request for a
System.Lazy`1 and context
can satisfy a
request for a System.Func<TResult> specimen,
the System.Func<TResult>'s value will be used when lazy
initialization occurs. If not, the return value is a
NoSpecimen instance.