This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Probably a newby question, but how to I tell lightspeed that a GUID self-reference column to load the associated entity for that object. For normal items I know to do private readonly EntityHolder<TId> _name = new EntityHolder<TId>(); public TId Name { get{ return Get(_name);} set{ Set(_name, value};} } But I get a Lightseepd unable to resolve reference issue if I try the same thing with self referencing column from same table. I know there should be a way to do this, but haven't found it yet, any help would be greatly appreciated. |
|
|
We might need to see your full entity code to resolve this, but here are a couple things to check. First, your EntityHolder needs to specify the type of the referenced entity (in this case, the same as the referencing entity), not the type of the ID. Second, you need to declare the association in both directions, which in this case means declaring both the backreference and the children collection in the same class. Third, you need to declare a field to hold the foreign key value itself. Something like: public class Amoeba : Entity<Guid> { Hope this clarifies things. If you use the designer, it should take care of this for you (and even if you don't want to use the designer for real, you might find looking at the generated code a useful helper for your own code). Let us know if you need more info! |
|
|
Thanks Ivan, I had most of it, was just missing the EntityCollection code in mine, compiles and runs now, thanks for the assitance |
|