当前位置: 首页>>代码示例>>C#>>正文


C# EdmModel.SetEdmxVersion方法代码示例

本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmModel.SetEdmxVersion方法的典型用法代码示例。如果您正苦于以下问题:C# EdmModel.SetEdmxVersion方法的具体用法?C# EdmModel.SetEdmxVersion怎么用?C# EdmModel.SetEdmxVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.OData.Edm.Library.EdmModel的用法示例。


在下文中一共展示了EdmModel.SetEdmxVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateEdmModelCsdlSchemaWriter

 private static EdmModelCsdlSchemaWriter CreateEdmModelCsdlSchemaWriter(out XmlWriter xmlWriter, out MemoryStream memoryStream)
 {
     memoryStream = new MemoryStream();
     IEdmModel model = new EdmModel();
     model.SetEdmxVersion(new Version(4, 0));
     var namespaceAliasMappings = model.GetNamespaceAliases();
     Version edmxVersion = model.GetEdmxVersion();
     xmlWriter = XmlWriter.Create(memoryStream);
     return new EdmModelCsdlSchemaWriter(model, namespaceAliasMappings, xmlWriter, edmxVersion);
 }
开发者ID:larsenjo,项目名称:odata.net,代码行数:10,代码来源:EdmModelCsdlSchemaWriterTests.cs

示例2: EdmxRoundTripTestsEmptyConceptualModelsModel

 public void EdmxRoundTripTestsEmptyConceptualModelsModel()
 {
     var model = new EdmModel();
     model.SetEdmxVersion(EdmConstants.EdmVersion4);
     this.EdmxRoundTripCheck(EdmxModelBuilder.EmptyConceptualModelsEdmx(), EdmxTarget.EntityFramework, model);
 }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:6,代码来源:EdmxRoundTripTests.cs

示例3: EdmxRoundTripTestsEmptyDataServicesModel

 public void EdmxRoundTripTestsEmptyDataServicesModel()
 {
     var model = new EdmModel();
     model.SetEdmxVersion(EdmConstants.EdmVersion4);
     this.EdmxRoundTripCheck(EdmxModelBuilder.EmptyDataServicesEdmx(), EdmxTarget.OData, model);
 }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:6,代码来源:EdmxRoundTripTests.cs

示例4: VisitAndVerifyXml

        internal void VisitAndVerifyXml(Action<EdmModelCsdlSerializationVisitor> testAction, string expected)
        {
            XmlWriter xmlWriter;
            MemoryStream memStream;
            IEdmModel model = new EdmModel();

            model.SetEdmxVersion(new Version(4, 0));
            Version edmxVersion = model.GetEdmxVersion();
            memStream = new MemoryStream();
            xmlWriter = XmlWriter.Create(memStream, new XmlWriterSettings(){ConformanceLevel = ConformanceLevel.Auto});
            var visitor = new EdmModelCsdlSerializationVisitor(model, xmlWriter, edmxVersion);

            testAction(visitor);
            xmlWriter.Flush();
            memStream.Seek(0, SeekOrigin.Begin);
            StreamReader reader = new StreamReader(memStream);
            
            // Remove extra xml header text as its not needed.
            string result = reader.ReadToEnd().Replace(@"<?xml version=""1.0"" encoding=""utf-8""?>", string.Empty);
            Assert.AreEqual(expected, result);
        }
开发者ID:rossjempson,项目名称:odata.net,代码行数:21,代码来源:EdmModelCsdlSerializationVisitorTests.cs


注:本文中的Microsoft.OData.Edm.Library.EdmModel.SetEdmxVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。