Dear all,
I get the following error after using the "FindOne<T>"-method:
"Mindscape.Lightspeed.LighspeedException
Could not determine the reverse association of [Word.WordToWord (IList<WordToWord>)]"
I have two tables "Word" and "WordToWord". Each word can be linked with a any number of other words. I.e. it is a many-to-many association with one table beeing the source and destination table ("Word"). What is the mistake?
Below you find the corresponding definitions.
Thanks for your answer,
Henning
Class "Word":
public class Word : Entity<int>
{
#region private members
#region values types
[ValidatePresence]
private string _Text;
#endregion
#region relations
//ManyToMany
private readonly EntityCollection<WordToWord> _WordToWord = new EntityCollection<WordToWord>();
private readonly EntityCollection<WordToWord> _WordToWordReverse = new EntityCollection<WordToWord>();
private readonly ThroughAssociation<WordToWord, Word> _WordLinks;
private readonly ThroughAssociation<WordToWord, Word> _WordLinksReverse;
#endregion
#endregion
#region constructor
public Word()
{
_WordLinks = new ThroughAssociation<WordToWord, Word>(_WordToWord);
_WordLinksReverse = new ThroughAssociation<WordToWord, Word>(_WordToWordReverse);
}
#endregion
#region public properties
public string Text
{
get { return _Text; }
set { this.Set(ref _Text, value); }
}
public ThroughAssociation<WordToWord, Word> WordLinks
{
get { return Get(_WordLinks); }
}
public ThroughAssociation<WordToWord, Word> WordLinksReverse
{
get { return Get(_WordLinksReverse); }
}
#endregion
}
Class "WordtoWord":
public class WordToWord : Entity<int>
{
#region private members
#region value types
private int _WordId;
private int _LinkedToWordId;
#endregion
#region relations
[ReverseAssociation("WordLinks")]
public readonly EntityHolder<Word> _Word = new EntityHolder<Word>();
[ReverseAssociation("WordLinksReverse")]
public readonly EntityHolder<Word> _LinkedToWord = new EntityHolder<Word>();
#endregion
#endregion
#region public properties
public Word Word
{
get { return Get(_Word); }
set { Set(_Word, value); }
}
public Word LinkedToWord
{
get { return Get(_LinkedToWord); }
set { Set(_LinkedToWord, value); }
}
#endregion
}