Ejemplo n.º 1
0
        /// <summary>
        ///  Returns an IEdmModel for the given CSDL artifacts.
        /// </summary>
        /// <param name="readers">Collection of XmlReaders containing the CSDL artifacts.</param>
        /// <param name="references">Models to be references by the created model.</param>
        /// <param name="model">The model generated by parsing.</param>
        /// <param name="errors">Errors reported while parsing.</param>
        /// <returns>Success of the parse operation.</returns>
        public static bool TryParse(IEnumerable <XmlReader> readers, IEnumerable <IEdmModel> references, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            CsdlModel ast;

            if (CsdlParser.TryParse(readers, out ast, out errors))
            {
                model = new CsdlSemanticsModel(ast, new CsdlSemanticsDirectValueAnnotationsManager(), references);
                return(true);
            }

            model = null;
            return(false);
        }