DbExpressionBuilder.NewEmptyCollection Method (TypeUsage)

 

Creates a new DbNewInstanceExpression that constructs an empty collection of the specified collection type.

Namespace:   System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
Assembly:  EntityFramework (in EntityFramework.dll)

public static DbNewInstanceExpression NewEmptyCollection(
	this TypeUsage collectionType
)

Parameters

collectionType
Type: System.Data.Entity.Core.Metadata.Edm.TypeUsage

The type metadata for the collection to create.

Return Value

Type: System.Data.Entity.Core.Common.CommandTrees.DbNewInstanceExpression

A new DbNewInstanceExpression with the specified collection type and an empty Arguments list.

Exception Condition
ArgumentNullException

collectionType is null.

ArgumentException

collectionType is not a collection type.