[]
        
(Showing Draft Content)

C1.Web.Mvc.Fluent.ListItemFactory-2

ListItemFactory<TItem, TItemBuilder> Class

Define a class used to build a strongly typed list of objects.

Inheritance
HideObjectMembers
BaseBuilder<IList<TItem>, ListItemFactory<TItem, TItemBuilder>>
ListItemFactory<TItem, TItemBuilder>
Namespace: C1.Web.Mvc.Fluent
Assembly: C1.AspNetCore.Mvc.dll
Syntax
public class ListItemFactory<TItem, TItemBuilder> : BaseBuilder<IList<TItem>, ListItemFactory<TItem, TItemBuilder>> where TItem : class, new() where TItemBuilder : BaseBuilder<TItem, TItemBuilder>
Type Parameters
Name Description
TItem

The specified type of the item

TItemBuilder

The specified type of the item builder.

Constructors

Name Description
ListItemFactory(IList<TItem>, Func<TItem, TItemBuilder>)

Initializes an instance of the ListItemFactory<TItem, TItemBuilder> class by using the specified collection.

ListItemFactory(IList<TItem>, Func<TItem>, Func<TItem, TItemBuilder>)

Initializes an instance of the ListItemFactory<TItem, TItemBuilder> class by using the specified collection.

Methods

Name Description
Add()

Add a default TItem instance to the collection.

Add(Action<TItemBuilder>)

Add a TItem instance updated by the specified action to the collection.

Add(TItem)

Add a TItem instance to the collection.