fluent-nhibernate icon indicating copy to clipboard operation
fluent-nhibernate copied to clipboard

HasMany interfaces

Open jagregory opened this issue 14 years ago • 1 comments
trafficstars

HasMany doesn't work well with collections of interfaces (especially when using Reveal)

public class Episode
{
  private IList<IContributor> contributors = new List<IContributor>();
}

public static OneToManyPart<T> ChildType<T>(this OneToManyPart<T> part, Type type)
{
  part.GetType()
    .GetField("valueType", BindingFlags.Instance | BindingFlags.NonPublic)
    .SetValue(part, type);
  part.GetType()
    .GetField("isTernary", BindingFlags.Instance | BindingFlags.NonPublic)
    .SetValue(part, true);

  return part;
}

jagregory avatar Jul 21 '11 22:07 jagregory

Any update on this?

ravensorb avatar Feb 14 '18 20:02 ravensorb