In my app I have a DocumentEntity (B) that is inherited by EmailEntity (C), so based on the DelegatePredicate example in the docs I'm trying to do this in my A class:
private EntityView<EmailEntity> Emails
{
get
{
PredicateExpression filter = new PredicateExpression(new DelegatePredicate(
delegate(IEntityCore toExamine)
{
return typeof(EmailEntity).IsAssignableFrom(toExamine.GetType());
}));
return new EntityView<EmailEntity>(this.Documents, filter);
}
}
Except this won't compile because the constructor for the EntityView requires an EmailEntity collection.
I suspect I'm either going to have to manually create an EmailEntity collection (and so miss out on changes in the base collection) or I'll have to provide a DocumentEntity collection and cast each item in my client - neither is desirable.