예제 #1
0
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX artifact.</param>
        /// <param name="references">Models 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, IEnumerable <IEdmModel> references, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            EdmUtil.CheckArgumentNull(references, "references");
            EdmxReader edmxReader = new EdmxReader(reader, null);

            return(edmxReader.TryParse(references, out model, out errors));
        }
예제 #2
0
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX artifact.</param>
        /// <param name="ignoreUnexpectedAttributesAndElements">Ignore the unexpected attributes and elements in schema.</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, bool ignoreUnexpectedAttributesAndElements, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            EdmxReader edmxReader = new EdmxReader(reader, null);

            edmxReader.ignoreUnexpectedAttributesAndElements = ignoreUnexpectedAttributesAndElements;
            return(edmxReader.TryParse(Enumerable.Empty <IEdmModel>(), out model, out errors));
        }
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX artifact.</param>
        /// <param name="references">Models to be referenced by the created model.</param>
        /// <param name="settings">EdmxReader settings for current parser.</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, IEnumerable <IEdmModel> references, EdmxReaderSettings settings, out IEdmModel model, out IEnumerable <EdmError> errors)
        {
            if (settings == null)
            {
                return(TryParse(reader, references, out model, out errors));
            }

            EdmxReader edmxReader = new EdmxReader(reader, settings.GetReferencedModelReaderFunc)
            {
                ignoreUnexpectedAttributesAndElements = settings.IgnoreUnexpectedAttributesAndElements
            };

            return(edmxReader.TryParse(references, out model, out errors));
        }
예제 #4
0
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX 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)
        {
            EdmxReader edmxReader = new EdmxReader(reader, null);

            return(edmxReader.TryParse(Enumerable.Empty <IEdmModel>(), out model, out errors));
        }
예제 #5
0
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX 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)
        {
            EdmxReader edmxReader = new EdmxReader(reader, null);

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

            return(edmxReader.TryParse(Enumerable.Empty <IEdmModel>(), out model, out errors));
        }
예제 #7
0
 /// <summary>
 /// Tries parsing the given EDMX artifact for an IEdmModel.
 /// </summary>
 /// <param name="reader">XmlReader containing the EDMX 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)
 {
     EdmxReader edmxReader = new EdmxReader(reader, null);
     return edmxReader.TryParse(Enumerable.Empty<IEdmModel>(), out model, out errors);
 }
예제 #8
0
        /// <summary>
        /// Tries parsing the given EDMX artifact for an IEdmModel.
        /// </summary>
        /// <param name="reader">XmlReader containing the EDMX artifact.</param>
        /// <param name="references">Models to be referenced by the created model.</param>
        /// <param name="settings">EdmxReader settings for current parser.</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, IEnumerable<IEdmModel> references, EdmxReaderSettings settings, out IEdmModel model, out IEnumerable<EdmError> errors)
        {
            EdmUtil.CheckArgumentNull(references, "references");
            if (settings == null)
            {
                return TryParse(reader, references, out model, out errors);
            }

            EdmxReader edmxReader = new EdmxReader(reader, settings.GetReferencedModelReaderFunc)
            {
                ignoreUnexpectedAttributesAndElements = settings.IgnoreUnexpectedAttributesAndElements
            };
            return edmxReader.TryParse(references, out model, out errors);
        }
예제 #9
0
 /// <summary>
 /// Tries parsing the given EDMX artifact for an IEdmModel.
 /// </summary>
 /// <param name="reader">XmlReader containing the EDMX 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)
 {
     EdmxReader edmxReader = new EdmxReader(reader, null);
     return edmxReader.TryParse(new[] { reference }, out model, out errors);
 }
예제 #10
0
 /// <summary>
 /// Tries parsing the given EDMX artifact for an IEdmModel.
 /// </summary>
 /// <param name="reader">XmlReader containing the EDMX artifact.</param>
 /// <param name="references">Models 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, IEnumerable<IEdmModel> references, out IEdmModel model, out IEnumerable<EdmError> errors)
 {
     EdmUtil.CheckArgumentNull(references, "references");
     EdmxReader edmxReader = new EdmxReader(reader, null);
     return edmxReader.TryParse(references, out model, out errors);
 }
예제 #11
0
 /// <summary>
 /// Tries parsing the given EDMX artifact for an IEdmModel.
 /// </summary>
 /// <param name="reader">XmlReader containing the EDMX 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)
 {
     EdmxReader edmxReader = new EdmxReader(reader, getReferencedModelReaderFunc);
     return edmxReader.TryParse(Enumerable.Empty<IEdmModel>(), out model, out errors);
 }
예제 #12
0
 /// <summary>
 /// Tries parsing the given EDMX artifact for an IEdmModel.
 /// </summary>
 /// <param name="reader">XmlReader containing the EDMX artifact.</param>
 /// <param name="ignoreUnexpectedAttributesAndElements">Ignore the unexpected attributes and elements in schema.</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, bool ignoreUnexpectedAttributesAndElements, out IEdmModel model, out IEnumerable<EdmError> errors)
 {
     EdmxReader edmxReader = new EdmxReader(reader, null);
     edmxReader.ignoreUnexpectedAttributesAndElements = ignoreUnexpectedAttributesAndElements;
     return edmxReader.TryParse(Enumerable.Empty<IEdmModel>(), out model, out errors);
 }