Join in object query

Mar 12, 2010 at 1:52 AM

The syntax for a join in an object query uses the type of the class (table) joined. What syntax do you use if there are two objects joined of the same type.

 

For example:

 

        [Relation("QuestionId = QuestionId", PersistRelationship = PersistRelationships.ChildFirst)]
private ObjectHolder<IQuestion> _currentQuestion = new ObjectHolder<IQuestion>();
/// <summary>
/// Specifies the connected "Question" persistent object.
/// </summary>
[XmlIgnore]
public IQuestion CurrentQuestion
{
get { return _currentQuestion.InnerObject; }
set { _currentQuestion.InnerObject = value; }
}
        [Relation("OriginalQuestionId = QuestionId", PersistRelationship = PersistRelationships.ChildFirst)]
private ObjectHolder<IQuestion> _originalQestion = new ObjectHolder<IQuestion>();
/// <summary>
/// Specifies the connected "Question" persistent object.
/// </summary>
[XmlIgnore]
public IQuestion OriginalQuestion
{
get { return _originalQestion .InnerObject; }
set { _originalQestion .InnerObject = value; }
}

 

 

        [Relation("QuestionId = QuestionId", PersistRelationship = PersistRelationships.ChildFirst)]
private ObjectHolder<IQuestion> _question = new ObjectHolder<IQuestion>();
/// <summary>
/// Specifies the connected "Question" persistent object.
/// </summary>
[XmlIgnore]
public IQuestion Question
{
get { return _question.InnerObject; }
set { _question.InnerObject = value; }

}

 

The samples say I should do "Question[WhateverId={0}]", but how do I reference a property?