[Field] public Entity OtherEntity{ get; set;} doesn't work, on Domain.Build() i get exception "Type 'Entity' is not registered." But my config containes: config.Types.Register(typeof(Entity).Assembly, typeof(Entity).Namespace); How can i declare a field to a general entity? This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by MSE-iT. |
The exception seems really rather strange, but the effect is correct: you can't create a reference to general Entity now, since its primary key isn't defined. Or you can consider it has a set of possible primary key types (i.e. keys of all the hierarchies), and thus DO doesn't know how to create an FK pointing to any of them. We're currently implementing a solution allowing handle this case: it will be possible to declare fields of Key type (or, probably, of Reference<t>). Such fields will be:
|