示例#1
0
        public void ParseIncludeAnnotationsWorksAsExpected()
        {
            string json = @" {
  ""$TermNamespace"": ""org.example.hcm"",
  ""$Qualifier"": ""Tablet"",
  ""$TargetNamespace"":   ""com.example.Person""  }";

            using (JsonDocument document = JsonDocument.Parse(json))
            {
                JsonElement rootElement = document.RootElement;

                JsonParserContext      context            = new JsonParserContext();
                CsdlIncludeAnnotations includeAnnotations = CsdlJsonParser.ParseIncludeAnnotations(rootElement, context);

                Assert.NotNull(includeAnnotations);
                Assert.Equal("org.example.hcm", includeAnnotations.TermNamespace);
                Assert.Equal("Tablet", includeAnnotations.Qualifier);
                Assert.Equal("com.example.Person", includeAnnotations.TargetNamespace);
            }
        }
示例#2
0
 public CsdlSemanticsIncludeAnnotations(CsdlSemanticsModel model, CsdlIncludeAnnotations includeAnnotations)
     : base(includeAnnotations)
 {
     this.model = model;
     this.includeAnnotations = includeAnnotations;
 }