Class LazyReadOnlyCollection<T>
Represents a lazily-initialized read-only collection.
Inheritance
object
Namespace: Umbraco.Cms.Core.Composing
Assembly: Umbraco.Core.dll
Syntax
public sealed class LazyReadOnlyCollection<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of elements in the collection. |
Constructors
View SourceLazyReadOnlyCollection(Func<IEnumerable<T>>)
Initializes a new instance of the LazyReadOnlyCollection<T> class.
Declaration
public LazyReadOnlyCollection(Func<IEnumerable<T>> lazyCollection)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IEnumerable<T>> | lazyCollection | A factory function that creates the collection when first accessed. |
LazyReadOnlyCollection(Lazy<IEnumerable<T>>)
Initializes a new instance of the LazyReadOnlyCollection<T> class.
Declaration
public LazyReadOnlyCollection(Lazy<IEnumerable<T>> lazyCollection)
Parameters
| Type | Name | Description |
|---|---|---|
| Lazy<IEnumerable<T>> | lazyCollection | A lazy wrapper containing the collection factory. |
Properties
View SourceCount
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
Value
Gets the underlying collection value.
Declaration
public IEnumerable<T> Value { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<T> |
Methods
View SourceGetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<T> |