fluent-nhibernate
fluent-nhibernate copied to clipboard
HasMany interfaces
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;
}
Any update on this?