Introduction
I am aware that \"user-defined conversions to or from a base class are not allowed\". MSDN gives, as an explanation to this rule, \"You
How about:
public class Entity {...}
public class Body : Entity
{
public Body(Entity sourceEntity) { this.Pointer = sourceEntity.Pointer; }
}
so in code you don't have to write:
Body someBody = new Body(previouslyUnknownEntity.Pointer);
but you can use
Body someBody = new Body(previouslyUnknownEntity);
instead.
It's just a cosmetic change, I know, but it is pretty clear and you can change the internals easily. It's also used in a wrapper pattern that I can't remember a name of (for slightly diff. purposes).
It's also clear you are creating a new entity from a provided one so should not be confusing as an operator/conversion would be.
Note: haven't used a compiler so possibility of a typo is there.