Show / Hide Table of Contents

Class CreateInstanceOptions<T>

Class representing the options for the create instance feature.

Inheritance
System.Object
CreateInstanceOptions<T>
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:Extend
Assembly:Extend.dll
Syntax
public class CreateInstanceOptions<T> : ICreateInstanceOptionsComplete<T>, IIncludeExcludeOptions<T>, IFactoryOptionsConstistent<T>, IFactoryOptionsInconsistent<T>, ICreateInstanceOptions<T> where T : class
Type Parameters
Name Description
T The type of the instance to create.

Properties

| Improve this Doc View Source

AnonymousItemName

Gets the name to use for anonymous items.

Declaration
public string AnonymousItemName { get; }
Property Value
Type Description
System.String

The name to use for anonymous items.

Implements
ICreateInstanceOptionsComplete<T>.AnonymousItemName
| Improve this Doc View Source

Factories

Gets all factories.

Declaration
public List<IInstanceFactory> Factories { get; }
Property Value
Type Description
System.Collections.Generic.List<T><IInstanceFactory>

All factories.

Implements
ICreateInstanceOptionsComplete<T>.Factories
| Improve this Doc View Source

MemberChildrenSelectionRules

Gets all member-children selection rules.

Declaration
public List<IMemberSelectionRule> MemberChildrenSelectionRules { get; }
Property Value
Type Description
System.Collections.Generic.List<T><IMemberSelectionRule>

All member-children selection rules.

Implements
ICreateInstanceOptionsComplete<T>.MemberChildrenSelectionRules
| Improve this Doc View Source

MemberSelectionRules

Gets all member selection rules.

Declaration
public List<IMemberSelectionRule> MemberSelectionRules { get; }
Property Value
Type Description
System.Collections.Generic.List<T><IMemberSelectionRule>

All member selection rules.

Implements
ICreateInstanceOptionsComplete<T>.MemberSelectionRules
| Improve this Doc View Source

PopulateCollections

Gets a value determining whether collection members should be populated or not.

Declaration
public bool ? PopulateCollections { get; }
Property Value
Type Description
System.Nullable<T><System.Boolean>

A value determining whether collection members should be populated or not.

Implements
ICreateInstanceOptionsComplete<T>.PopulateCollections
| Improve this Doc View Source

PopulateCollectionsMaxCount

Gets the maximum number of items to create.

Declaration
public int ? PopulateCollectionsMaxCount { get; }
Property Value
Type Description
System.Nullable<T><System.Int32>

The maximum number of items to create.

Implements
ICreateInstanceOptionsComplete<T>.PopulateCollectionsMaxCount
| Improve this Doc View Source

PopulateCollectionsMinCount

Gets the minimum number of items to create.

Declaration
public int ? PopulateCollectionsMinCount { get; }
Property Value
Type Description
System.Nullable<T><System.Int32>

The minimum number of items to create.

Implements
ICreateInstanceOptionsComplete<T>.PopulateCollectionsMinCount

Methods

| Improve this Doc View Source

AllMembers()

Matches all members.

Declaration
public IIncludeExcludeOptions<T> AllMembers()
Returns
Type Description
IIncludeExcludeOptions<T><T>

Returns the modified options.

Implements
IIncludeExcludeOptions<T>.AllMembers()
| Improve this Doc View Source

ByPath(Expression<Func<T, Object>>)

Matches for members which have a matching path.

Declaration
public IIncludeExcludeOptions<T> ByPath(Expression<Func<T, object>> expression)
Parameters
Type Name Description
System.Linq.Expressions.Expression<TDelegate><System.Func<T, TResult><T, System.Object>> expression

Expression representing the member path.

Returns
Type Description
IIncludeExcludeOptions<T><T>

Returns the modified options.

Implements
IIncludeExcludeOptions<T>.ByPath(Expression<Func<T, Object>>)
Exceptions
Type Condition
System.ArgumentNullException

expression can no the null.

| Improve this Doc View Source

ByPath(String)

Matches for members which have a matching path.

Declaration
public IIncludeExcludeOptions<T> ByPath(string path)
Parameters
Type Name Description
System.String path

The member path.

Returns
Type Description
IIncludeExcludeOptions<T><T>

Returns the modified options.

Implements
IIncludeExcludeOptions<T>.ByPath(String)
Exceptions
Type Condition
System.ArgumentNullException

path can no the null.

| Improve this Doc View Source

Complete()

Ends the configuration and returns the configuration result.

Declaration
public ICreateInstanceOptionsComplete<T> Complete()
Returns
Type Description
ICreateInstanceOptionsComplete<T><T>

Returns the completely configured create instance options.

Implements
ICreateInstanceOptions<T>.Complete()
| Improve this Doc View Source

Excluding(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Excludes all members matching the specified options.

Declaration
public 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 configure the exclude.

Returns
Type Description
ICreateInstanceOptions<T><T>

Returns the modified create instance options.

Implements
ICreateInstanceOptions<T>.Excluding(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

Excluding(Func<IMemberInformation, Boolean>)

Excludes all members matching the given predicate.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.Excluding(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

ExcludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Excludes the children of all members matching the specified options. The members themselves will still get created.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.ExcludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

ExcludingChildrenOf(Func<IMemberInformation, Boolean>)

Excludes the children of all members matching the given predicate. The members themselves will still get created.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.ExcludingChildrenOf(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

For(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Factory will be used to create values for members matching the specified options.

Declaration
public IFactoryOptionsConstistent<T> For(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 factory.

Returns
Type Description
IFactoryOptionsConstistent<T><T>

Returns the modified create instance options.

Implements
IFactoryOptionsInconsistent<T>.For(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

For(Func<IMemberInformation, Boolean>)

Factory will be used to create values for members matching the given predicate.

Declaration
public IFactoryOptionsConstistent<T> For(Func<IMemberInformation, bool> predicate)
Parameters
Type Name Description
System.Func<T, TResult><IMemberInformation, System.Boolean> predicate

The predicate used to find the members which should get created by the factory.

Returns
Type Description
IFactoryOptionsConstistent<T><T>

Returns the modified create instance options.

Implements
IFactoryOptionsInconsistent<T>.For(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

Including(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Includes all members matching the specified options.

Declaration
public 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 configure the exclude.

Returns
Type Description
ICreateInstanceOptions<T><T>

Returns the modified create instance options.

Implements
ICreateInstanceOptions<T>.Including(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

Including(Func<IMemberInformation, Boolean>)

Includes all members matching the given predicate.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.Including(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

IncludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Includes the children of all members matching the specified options.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.IncludingChildrenOf(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

IncludingChildrenOf(Func<IMemberInformation, Boolean>)

Includes the children of all members matching the given predicate.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.IncludingChildrenOf(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

IsNotTypeOf<TTarget>()

Adds a type based member selection rule.

Declaration
public IIncludeExcludeOptions<T> IsNotTypeOf<TTarget>()
Returns
Type Description
IIncludeExcludeOptions<T><T>

Returns the modified options.

Type Parameters
Name Description
TTarget The type to match.
Implements
IIncludeExcludeOptions<T>.IsNotTypeOf<TTarget>()
| Improve this Doc View Source

IsTypeOf<TTarget>()

Adds a type based member selection rule.

Declaration
public IIncludeExcludeOptions<T> IsTypeOf<TTarget>()
Returns
Type Description
IIncludeExcludeOptions<T><T>

Returns the modified options.

Type Parameters
Name Description
TTarget The type to match.
Implements
IIncludeExcludeOptions<T>.IsTypeOf<TTarget>()
| Improve this Doc View Source

NotFor(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)

Factory will NOT be used to create values for members matching the specified options.

Declaration
public IFactoryOptionsConstistent<T> NotFor(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 factory.

Returns
Type Description
IFactoryOptionsConstistent<T><T>

Returns the modified create instance options.

Implements
IFactoryOptionsInconsistent<T>.NotFor(Func<IIncludeExcludeOptions<T>, IIncludeExcludeOptions<T>>)
Exceptions
Type Condition
System.ArgumentNullException

configurationFunc can not be null.

| Improve this Doc View Source

NotFor(Func<IMemberInformation, Boolean>)

Factory will NOT be used to create values for members matching the given predicate.

Declaration
public IFactoryOptionsConstistent<T> NotFor(Func<IMemberInformation, bool> predicate)
Parameters
Type Name Description
System.Func<T, TResult><IMemberInformation, System.Boolean> predicate

The predicate used to find the members which should NOT get created by the factory.

Returns
Type Description
IFactoryOptionsConstistent<T><T>

Returns the modified create instance options.

Implements
IFactoryOptionsInconsistent<T>.NotFor(Func<IMemberInformation, Boolean>)
Exceptions
Type Condition
System.ArgumentNullException

predicate can not be null.

| Improve this Doc View Source

PopulateCollectionItemCount(Nullable<Int32>, Nullable<Int32>)

Configures the number of items to create for collection members.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.PopulateCollectionItemCount(Nullable<Int32>, Nullable<Int32>)
Exceptions
Type Condition
System.ArgumentException

Maximum is not greater than minimum.

| Improve this Doc View Source

PopulateCollectionMembers(Nullable<Boolean>)

Configures the creation of collection items.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.PopulateCollectionMembers(Nullable<Boolean>)
| Improve this Doc View Source

SetAnonymousItemName(String)

Configures the name of anonymous items.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.SetAnonymousItemName(String)
| Improve this Doc View Source

WithFactory(Func<IMemberInformation, Object>)

Adds the given factory to the value providers.

Declaration
public 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.

Implements
ICreateInstanceOptions<T>.WithFactory(Func<IMemberInformation, Object>)
Exceptions
Type Condition
System.ArgumentNullException

factory can not be null.

Extension Methods

ObjectEx.SatisfiesWithMessages<T>(T, ISpecification<T>)
ObjectEx.Specification<T>(T, Func<T, Boolean>, String)
ObjectEx.GetNameChain<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
ObjectEx.GetNameChain<TObject, TMember>(TObject, Expression<Func<TMember>>)
ObjectEx.Swap<T>(Object, ref T, ref T)
ObjectEx.ToSingleItemArray<T>(T)
ObjectEx.Maximum<TSource>(TSource, TSource[])
ObjectEx.Maximum<TSource, TResult>(TSource, Func<TSource, TResult>, TSource[])
ObjectEx.Minimum<TSource>(TSource, TSource[])
ObjectEx.Minimum<TSource, TResult>(TSource, Func<TSource, TResult>, TSource[])
ObjectEx.Satisfies<T>(T, ISpecification<T>)
ObjectEx.IfNull<T>(T, T)
ObjectEx.ThrowIfNull<TObject>(TObject, Expression<Func<TObject>>, String)
ObjectEx.ThrowIfNull<TObject>(TObject, String, String)
ObjectEx.GetName<TObject, TMember>(TObject, Expression<Func<TObject, TMember>>)
ObjectEx.GetName<TObject, TMember>(TObject, Expression<Func<TMember>>)
ObjectEx.IsNull(Object)
ObjectEx.IsNotNull(Object)
ObjectEx.As<T>(Object)
ObjectEx.Chain<T>(T, Action<T>)
ObjectEx.RefEquals(Object, Object)
ObjectEx.Coalesce<T>(T, T[])
ObjectEx.Coalesce<T>(T, T)
ObjectEx.CoalesceOrDefault<T>(T, T, T[])
ObjectEx.CoalesceOrDefault<T>(T, Func<T>, T[])
ObjectEx.ExecuteSafe<T>(T, Action<T>)
ObjectEx.ExecuteSafe<T, TResult>(T, Func<T, TResult>)
ObjectEx.ToBoolean(Object)
ObjectEx.ToBoolean(Object, IFormatProvider)
ObjectEx.ToByte(Object)
ObjectEx.ToByte(Object, IFormatProvider)
ObjectEx.ToChar(Object)
ObjectEx.ToChar(Object, IFormatProvider)
ObjectEx.ToDateTime(Object)
ObjectEx.ToDateTime(Object, IFormatProvider)
ObjectEx.ToDecimal(Object)
ObjectEx.ToDecimal(Object, IFormatProvider)
ObjectEx.ToDouble(Object)
ObjectEx.ToDouble(Object, IFormatProvider)
ObjectEx.ToInt32(Object)
ObjectEx.ToInt32(Object, IFormatProvider)
ObjectEx.ToInt16(Object)
ObjectEx.ToInt16(Object, IFormatProvider)
ObjectEx.ToInt64(Object)
ObjectEx.ToInt64(Object, IFormatProvider)
ObjectEx.IsIn<T>(T, T[])
ObjectEx.IsIn<T>(T, IEnumerable<T>)
ObjectEx.IsNotIn<T>(T, T[])
ObjectEx.IsNotIn<T>(T, IEnumerable<T>)
ObjectEx.IsDefault<T>(T)
DecimalEx.Sum<TSource>(TSource, Func<TSource, Decimal>, TSource[])
DecimalEx.Sum<TSource>(TSource, Func<TSource, Nullable<Decimal>>, TSource[])
DoubleEx.Sum<TSource>(TSource, Func<TSource, Double>, TSource[])
DoubleEx.Sum<TSource>(TSource, Func<TSource, Nullable<Double>>, TSource[])
Int32Ex.Sum<TSource>(TSource, Func<TSource, Int32>, TSource[])
Int32Ex.Sum<TSource>(TSource, Func<TSource, Nullable<Int32>>, TSource[])
Int64Ex.Sum<TSource>(TSource, Func<TSource, Int64>, TSource[])
Int64Ex.Sum<TSource>(TSource, Func<TSource, Nullable<Int64>>, TSource[])
InstanceCreator.CreateInstance<T>(ICreateInstanceOptionsComplete<T>)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2016 Microsoft
Generated by DocFX