Interface ICreateInstanceOptions<T>
Interface representing a set of options used to create an instance of a type.
Namespace:Extend
Assembly:Extend.dll
Syntax
public interface ICreateInstanceOptions<T>
where T : class
Type Parameters
Name | Description |
---|---|
T | The type of the instance to create. |
Methods
| Improve this Doc View SourceComplete()
Ends the configuration and returns the configuration result.
Declaration
ICreateInstanceOptionsComplete<T> Complete()
Returns
Type | Description |
---|---|
ICreateInstanceOptionsComplete<T><T> | Returns the completely configured create instance options. |
Excluding(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Excludes all members matching the specified options.
Declaration
ICreateInstanceOptions<T> Excluding(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>> configurationFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IIncludeExcludeOptions<T><T>, IIncludeExcludeOptions<T><T>> | configurationFunc | Function used to configuration the exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
Excluding(Func<IMemberInformation, Boolean>)
Excludes all members matching the given predicate.
Declaration
ICreateInstanceOptions<T> Excluding(Func<IMemberInformation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IMemberInformation, System.Boolean> | predicate | The predicate used to find the members to exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
ExcludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Excludes the children of all members matching the specified options. The members themselves will still get created.
Declaration
ICreateInstanceOptions<T> ExcludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>> configurationFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IIncludeExcludeOptions<T><T>, IIncludeExcludeOptions<T><T>> | configurationFunc | Function used to configure the exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
ExcludingChildrenOf(Func<IMemberInformation, Boolean>)
Excludes the children of all members matching the given predicate. The members themselves will still get created.
Declaration
ICreateInstanceOptions<T> ExcludingChildrenOf(Func<IMemberInformation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IMemberInformation, System.Boolean> | predicate | The predicate used to find the members to exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
Including(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Includes all members matching the specified options.
Declaration
ICreateInstanceOptions<T> Including(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>> configurationFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IIncludeExcludeOptions<T><T>, IIncludeExcludeOptions<T><T>> | configurationFunc | Function used to configuration the exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
Including(Func<IMemberInformation, Boolean>)
Includes all members matching the given predicate.
Declaration
ICreateInstanceOptions<T> Including(Func<IMemberInformation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IMemberInformation, System.Boolean> | predicate | The predicate used to find the members to include. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
IncludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Includes the children of all members matching the specified options.
Declaration
ICreateInstanceOptions<T> IncludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>> configurationFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IIncludeExcludeOptions<T><T>, IIncludeExcludeOptions<T><T>> | configurationFunc | Function used to configure the exclude. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
IncludingChildrenOf(Func<IMemberInformation, Boolean>)
Includes the children of all members matching the given predicate.
Declaration
ICreateInstanceOptions<T> IncludingChildrenOf(Func<IMemberInformation, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IMemberInformation, System.Boolean> | predicate | The predicate used to find the members to include. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
PopulateCollectionItemCount(Nullable<Int32>, Nullable<Int32>)
Configures the number of items to create for collection members.
Declaration
ICreateInstanceOptions<T> PopulateCollectionItemCount(int ? min, int ? max)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<T><System.Int32> | min | The minimum number of items to create. |
System.Nullable<T><System.Int32> | max | The maximum number of items to create. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Maximum is not greater than minimum. |
PopulateCollectionMembers(Nullable<Boolean>)
Configures the creation of collection items.
Declaration
ICreateInstanceOptions<T> PopulateCollectionMembers(bool ? populateCollections)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<T><System.Boolean> | populateCollections | A value determining whether items for collection types should be created or not. Null means use default configuration. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
SetAnonymousItemName(String)
Configures the name of anonymous items.
Declaration
ICreateInstanceOptions<T> SetAnonymousItemName(string anonymousItemName)
Parameters
Type | Name | Description |
---|---|---|
System.String | anonymousItemName | The name used for anonymous items, or null to use global configuration. |
Returns
Type | Description |
---|---|
ICreateInstanceOptions<T><T> | Returns the modified create instance options. |
WithFactory(Func<IMemberInformation, Object>)
Adds the given factory to the value providers.
Declaration
IFactoryOptionsInconsistent<T> WithFactory(Func<IMemberInformation, object> factory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<T, TResult><IMemberInformation, System.Object> | factory | The factory to add. |
Returns
Type | Description |
---|---|
IFactoryOptionsInconsistent<T><T> | Returns the modified create instance options. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | factory can not be null. |