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) Version: 3.2.0.4000 (3.2.0.4000)

Syntax

C#
[SerializableAttribute]
public class PersistentBag : AbstractPersistentCollection, 
	IList, ICollection, IEnumerable
Visual Basic
<SerializableAttribute> _
Public Class PersistentBag _
	Inherits AbstractPersistentCollection _
	Implements IList, ICollection, IEnumerable
Visual C++
[SerializableAttribute]
public ref class PersistentBag : public AbstractPersistentCollection, 
	IList, ICollection, IEnumerable

Inheritance Hierarchy

See Also