private XmlReader CreateSectionReader(EdmxSection edmxSection) { DebugCheck.NotNull(edmxSection); var edmxDocument = XElement.Load(_edmxPath, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); var runtime = edmxDocument.Element(EDMX_NAMESPACES, "Runtime"); if (runtime == null) { return(null); } var section = runtime.Element(EDMX_NAMESPACES, edmxSection.SectionName); if (section == null) { return(null); } var rootElement = section.Element(edmxSection.Namespaces, edmxSection.RootElementName); if (rootElement == null) { return(null); } return(rootElement.CreateReader()); }
private XmlReader CreateSectionReader(EdmxSection edmxSection) { DebugCheck.NotNull(edmxSection); var edmxDocument = XElement.Load(_edmxPath, LoadOptions.SetBaseUri | LoadOptions.SetLineInfo); var runtime = edmxDocument.Element(EDMX_NAMESPACES, "Runtime"); if (runtime == null) { return null; } var section = runtime.Element(EDMX_NAMESPACES, edmxSection.SectionName); if (section == null) { return null; } var rootElement = section.Element(edmxSection.Namespaces, edmxSection.RootElementName); if (rootElement == null) { return null; } return rootElement.CreateReader(); }
static EdmxSection() { Csdl = new EdmxSection { Namespaces = new XNamespace[] { "http://schemas.microsoft.com/ado/2009/11/edm", "http://schemas.microsoft.com/ado/2008/09/edm", "http://schemas.microsoft.com/ado/2006/04/edm" }, SectionName = "ConceptualModels", RootElementName = "Schema" }; Msl = new EdmxSection { Namespaces = new XNamespace[] { "http://schemas.microsoft.com/ado/2009/11/mapping/cs", "http://schemas.microsoft.com/ado/2008/09/mapping/cs", "urn:schemas-microsoft-com:windows:storage:mapping:CS" }, SectionName = "Mappings", RootElementName = "Mapping" }; Ssdl = new EdmxSection { Namespaces = new XNamespace[] { "http://schemas.microsoft.com/ado/2009/11/edm/ssdl", "http://schemas.microsoft.com/ado/2009/02/edm/ssdl", "http://schemas.microsoft.com/ado/2006/04/edm/ssdl" }, SectionName = "StorageModels", RootElementName = "Schema" }; }