Skip to content

Instantly share code, notes, and snippets.

View krisdages's full-sized avatar

Kris Dages krisdages

  • Enverus
  • Austin, TX
View GitHub Profile
@krisdages
krisdages / ChildList.cs
Created June 3, 2011 01:55
Child List for bidirectional nHibernate one-to-many collections
//IList<Child> childList = new ChildList<Parent, Child>(parent, (p, c) => { c.Parent = p; });
/// <summary>
/// List of objects that maintain a reference to their parent object. Adding and removing from the list call a lambda-based
/// setter to set the parent reference.
/// </summary>
/// <typeparam name="TParent"></typeparam>
/// <typeparam name="TChild"></typeparam>
public class ChildList<TParent, TChild> : IList<TChild>, ICollection
where TParent : class