Export (0) Print
Expand All
Expand Minimize

DbExpressionBuilder.NewEmptyCollection Method

.NET Framework 4.6 and 4.5

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

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

public static DbNewInstanceExpression NewEmptyCollection(
	this TypeUsage collectionType


Type: System.Data.Metadata.Edm.TypeUsage

The type metadata for the collection to create

Return Value

Type: System.Data.Common.CommandTrees.DbNewInstanceExpression
A new DbNewInstanceExpression with the specified collection type and an empty Arguments list.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type TypeUsage. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).


collectionType is null.


collectionType is not a collection type.

.NET Framework

Supported in: 4.6, 4.5
© 2015 Microsoft