Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / EntityModel / SchemaObjectModel / Property.cs
1 //---------------------------------------------------------------------
2 // <copyright file="Property.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner       Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
9
10 using System;
11 using System.Collections;
12 using System.Collections.Generic;
13 using System.Collections.Specialized;
14 using System.Diagnostics;
15 using System.Xml;
16 using System.Data;
17 using System.Data.Metadata.Edm;
18 using System.Reflection;
19 using System.IO;
20 using System.Globalization;
21
22 namespace System.Data.EntityModel.SchemaObjectModel
23 {
24
25     internal abstract class Property : SchemaElement
26     {
27         /// <summary>
28         /// Creates a Property object
29         /// </summary>
30         /// <param name="parentElement">The parent element</param>
31         internal Property(StructuredType parentElement)
32             : base(parentElement)
33         {
34         }
35
36         /// <summary>
37         /// Gets the Type of the property
38         /// </summary>
39         public abstract SchemaType Type { get;}
40
41         protected override bool HandleElement(XmlReader reader)
42         {
43             if (base.HandleElement(reader))
44             {
45                 return true;
46             }
47             else if (Schema.DataModel == SchemaDataModelOption.EntityDataModel)
48             {
49                 if (CanHandleElement(reader, XmlConstants.ValueAnnotation))
50                 {
51                     // EF does not support this EDM 3.0 element, so ignore it.
52                     SkipElement(reader);
53                     return true;
54                 }
55                 else if (CanHandleElement(reader, XmlConstants.TypeAnnotation))
56                 {
57                     // EF does not support this EDM 3.0 element, so ignore it.
58                     SkipElement(reader);
59                     return true;
60                 }
61             }
62             return false;
63         }
64     }
65 }