Adapter, 5.7
Is there a faster or better way to do this, determine if the start of a IPrefetchPathElement2
is of a particular entity type?
static bool StartAtEntityType(IEntity2 entity2, IPrefetchPathElement2 pathElement)
{
return entity2.GetAllRelations().Any(r => r.ToString() == pathElement.Relation.ToString());
}
I see that IPrefetchPathElement2 has 2 interesting properties, DestinationEntityType
and ToFetchEntityType
but they are numbers, not Type
s . Is there for example a way to go from those numbers to a Type
or from an IEntityFactory2
or IEntity2
to the number?
(I'm trying to write an entity cloner where I can specify the graph shape via a list of graph paths(edges).)
Thanks,