예제 #1
0
        /// <summary>
        /// Tries parsing the given CSDL artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the CSDL artifact.</param>
        /// <param name="reference">Model to be referenced 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(XmlReader reader, IEdmModel reference, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            CsdlReader edmxReader = new CsdlReader(reader, null);

            return(edmxReader.TryParse(new[] { reference }, out model, out errors));
        }
예제 #2
0
        /// <summary>
        /// Tries parsing the given CSDL artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the CSDL artifact.</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(XmlReader reader, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            CsdlReader edmxReader = new CsdlReader(reader, null);

            return(edmxReader.TryParse(Enumerable.Empty <IEdmModel>(), out model, out errors));
        }
예제 #3
0
        /// <summary>
        /// Tries parsing the given CSDL artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the CSDL artifact.</param>
        /// <param name="getReferencedModelReaderFunc">The function to load referenced model xml. If null, will stop loading the referenced models. Normally it should throw no exception.</param>
        /// <param name="model">The model generated by parsing</param>
        /// <param name="errors">Errors reported while parsing.</param>
        /// <remarks>If getReferencedModelReaderFunc throws exception, it won't be caught internally but will be thrown out for caller to handle.</remarks>
        /// <returns>Success of the parse operation.</returns>
        /// <remarks>
        /// User should handle the disposal of XmlReader created by getReferencedModelReaderFunc.
        /// </remarks>
        public static bool TryParse(XmlReader reader, Func <Uri, XmlReader> getReferencedModelReaderFunc, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            CsdlReader edmxReader = new CsdlReader(reader, getReferencedModelReaderFunc);

            return(edmxReader.TryParse(Enumerable.Empty <IEdmModel>(), out model, out errors));
        }