/// <summary>
        /// Initializes a new instance of <see cref="QueryModel"/>
        /// </summary>
        /// <param name="mainFromClause">The <see cref="Clauses.MainFromClause"/> of the query. This is the starting point of the query, generating items
        /// that are filtered and projected by the query.</param>
        /// <param name="selectClause">The <see cref="SelectClause"/> of the query. This is the end point of
        /// the query, it defines what is actually returned for each of the items coming from the <see cref="MainFromClause"/> and passing the
        /// <see cref="BodyClauses"/>. After it, only the <see cref="ResultOperators"/> modify the result of the query.</param>
        public QueryModel(MainFromClause mainFromClause, SelectClause selectClause)
        {
            ArgumentUtility.CheckNotNull("mainFromClause", mainFromClause);
            ArgumentUtility.CheckNotNull("selectClause", selectClause);

            _uniqueIdentifierGenerator = new UniqueIdentifierGenerator();

            MainFromClause = mainFromClause;
            SelectClause   = selectClause;

            BodyClauses = new ObservableCollection <IBodyClause>();
            BodyClauses.CollectionChanged += BodyClauses_CollectionChanged;

            ResultOperators = new ObservableCollection <ResultOperatorBase>();
            ResultOperators.CollectionChanged += ResultOperators_CollectionChanged;
        }
    /// <summary>
    /// Initializes a new instance of <see cref="QueryModel"/>
    /// </summary>
    /// <param name="mainFromClause">The <see cref="Clauses.MainFromClause"/> of the query. This is the starting point of the query, generating items 
    /// that are filtered and projected by the query.</param>
    /// <param name="selectClause">The <see cref="SelectClause"/> of the query. This is the end point of
    /// the query, it defines what is actually returned for each of the items coming from the <see cref="MainFromClause"/> and passing the 
    /// <see cref="BodyClauses"/>. After it, only the <see cref="ResultOperators"/> modify the result of the query.</param>
    public QueryModel (MainFromClause mainFromClause, SelectClause selectClause)
    {
      ArgumentUtility.CheckNotNull ("mainFromClause", mainFromClause);
      ArgumentUtility.CheckNotNull ("selectClause", selectClause);

      _uniqueIdentifierGenerator = new UniqueIdentifierGenerator();

      MainFromClause = mainFromClause;
      SelectClause = selectClause;

      BodyClauses = new ObservableCollection<IBodyClause>();
      BodyClauses.CollectionChanged += BodyClauses_CollectionChanged;

      ResultOperators = new ObservableCollection<ResultOperatorBase>();
      ResultOperators.CollectionChanged += ResultOperators_CollectionChanged;
    }