///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Gets a relationship.
        /// </summary>
        /// <param name="id">
        ///  The identifier.
        /// </param>
        /// <param name="schemaRelationship">
        ///  (Optional) the schema relationship.
        /// </param>
        /// <returns>
        ///  The relationship.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public virtual IModelRelationship GetRelationship(Identity id, ISchemaRelationship schemaRelationship = null)
        {
            Contract.Requires(id, "id");

            CheckInitialized();
            return(L1Cache.GetElement(id, schemaRelationship) as IModelRelationship);
        }
        ///-------------------------------------------------------------------------------------------------
        /// <summary>
        ///  Gets an element.
        /// </summary>
        /// <param name="id">
        ///  The identifier.
        /// </param>
        /// <param name="schemaElement">
        ///  (Optional) the schema element.
        /// </param>
        /// <returns>
        ///  The element.
        /// </returns>
        ///-------------------------------------------------------------------------------------------------
        public virtual IModelElement GetElement(Identity id, ISchemaElement schemaElement = null)
        {
            CheckInitialized();

            if (id == null)
            {
                return(null);
            }

            IModelElement elem = L1Cache.GetElement(id, schemaElement);

            return(elem);
        }