An unordered, unkeyed collection that can contain the same element multiple times. The .NET collections API has no Bag class. Most developers seem to use ILists to represent bag semantics, so NHibernate follows this practice.

Namespace:  NHibernate.Collection
Assembly:  NHibernate (in NHibernate.dll)

Syntax

Visual Basic (Declaration)
<SerializableAttribute> _
Public Class PersistentBag _
	Inherits AbstractPersistentCollection _
	Implements IList, ICollection, IEnumerable
C#
[SerializableAttribute]
public class PersistentBag : AbstractPersistentCollection, 
	IList, ICollection, IEnumerable
Visual C++
[SerializableAttribute]
public ref class PersistentBag : public AbstractPersistentCollection, 
	IList, ICollection, IEnumerable
JavaScript
NHibernate.Collection.PersistentBag = function();

Type.createClass(
	'NHibernate.Collection.PersistentBag',
	NHibernate.Collection.AbstractPersistentCollection,
	IList,
	ICollection,
	IEnumerable);

Inheritance Hierarchy

System..::.Object
  NHibernate.Collection..::.AbstractPersistentCollection
    NHibernate.Collection..::.PersistentBag

See Also