Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HasMany interfaces #49

Open
jagregory opened this issue Jul 21, 2011 · 1 comment
Open

HasMany interfaces #49

jagregory opened this issue Jul 21, 2011 · 1 comment
Labels
Milestone

Comments

@jagregory
Copy link
Collaborator

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;
}
@ravensorb
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants