1+ //-----------------------------------------------------------------------------
2+ // <copyright file="DeltaDeletedEntityObjectOfT.cs" company=".NET Foundation">
3+ // Copyright (c) .NET Foundation and Contributors. All rights reserved.
4+ // See License.txt in the project root for license information.
5+ // </copyright>
6+ //------------------------------------------------------------------------------
7+
8+ using System ;
9+ using System . Collections . Generic ;
10+ using System . Reflection ;
11+ using Microsoft . OData ;
12+ using Microsoft . OData . Edm ;
13+
14+ namespace Microsoft . AspNet . OData
15+ {
16+ /// <summary>
17+ /// Represents an <see cref="IDeltaDeletedEntityObject"/> with a backing CLR <see cref="Type"/>.
18+ /// Used to hold the Deleted Entry object in the Delta Feed Payload.
19+ /// </summary>
20+ [ NonValidatingParameterBinding ]
21+ public class DeltaDeletedEntityObject < TStructuralType > : Delta < TStructuralType > , IDeltaDeletedEntityObject where TStructuralType : class
22+ {
23+ /// <summary>
24+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
25+ /// </summary>
26+ public DeltaDeletedEntityObject ( )
27+ : this ( typeof ( TStructuralType ) )
28+ {
29+ }
30+
31+ /// <summary>
32+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>
33+ /// </summary>
34+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
35+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
36+ /// </param>
37+ public DeltaDeletedEntityObject ( Type structuralType )
38+ : this ( structuralType , dynamicDictionaryPropertyInfo : null , instanceAnnotationsPropertyInfo : null )
39+ {
40+ }
41+
42+ /// <summary>
43+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
44+ /// </summary>
45+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
46+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
47+ /// </param>
48+ /// <param name="updatableProperties">Properties to update</param>
49+ public DeltaDeletedEntityObject ( Type structuralType , IEnumerable < string > updatableProperties )
50+ : this ( structuralType , updatableProperties , dynamicDictionaryPropertyInfo : null , instanceAnnotationsPropertyInfo : null )
51+ {
52+
53+ }
54+
55+ /// <summary>
56+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
57+ /// </summary>
58+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
59+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
60+ /// </param>
61+ /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for Instance Annotations</param>
62+ public DeltaDeletedEntityObject ( Type structuralType , PropertyInfo instanceAnnotationsPropertyInfo )
63+ : this ( structuralType , dynamicDictionaryPropertyInfo : null , instanceAnnotationsPropertyInfo )
64+ {
65+ }
66+
67+ /// <summary>
68+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
69+ /// </summary>
70+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
71+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
72+ /// </param>
73+ /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic
74+ /// properties. <c>null</c> means this entity type is not open.</param>
75+ /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for Instance Annotations</param>
76+ public DeltaDeletedEntityObject ( Type structuralType , PropertyInfo dynamicDictionaryPropertyInfo , PropertyInfo instanceAnnotationsPropertyInfo )
77+ : this ( structuralType , updatableProperties : null , dynamicDictionaryPropertyInfo , instanceAnnotationsPropertyInfo )
78+ {
79+
80+ }
81+
82+ /// <summary>
83+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
84+ /// </summary>
85+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
86+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
87+ /// </param>
88+ /// <param name="updatableProperties"> Properties that can be updated</param>
89+ /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic
90+ /// properties. <c>null</c> means this entity type is not open.</param>
91+ /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for Instance Annotations</param>
92+ public DeltaDeletedEntityObject ( Type structuralType , IEnumerable < string > updatableProperties , PropertyInfo dynamicDictionaryPropertyInfo , PropertyInfo instanceAnnotationsPropertyInfo )
93+ : this ( structuralType , updatableProperties , dynamicDictionaryPropertyInfo , false , instanceAnnotationsPropertyInfo )
94+ {
95+
96+ }
97+
98+ /// <summary>
99+ /// Initializes a new instance of <see cref="DeltaDeletedEntityObject{TStructuralType}"/>.
100+ /// </summary>
101+ /// <param name="structuralType">The derived entity type or complex type for which the changes would be tracked.
102+ /// <paramref name="structuralType"/> should be assignable to instances of <typeparamref name="TStructuralType"/>.
103+ /// </param>
104+ /// <param name="updatableProperties"> Properties that can be updated</param>
105+ /// <param name="dynamicDictionaryPropertyInfo">The property info that is used as dictionary of dynamic
106+ /// properties. <c>null</c> means this entity type is not open.</param>
107+ /// <param name="isComplexType">To determine if the entity is a complex type</param>
108+ /// <param name="instanceAnnotationsPropertyInfo">The property info that is used as container for Instance Annotations</param>
109+ public DeltaDeletedEntityObject ( Type structuralType , IEnumerable < string > updatableProperties , PropertyInfo dynamicDictionaryPropertyInfo , bool isComplexType , PropertyInfo instanceAnnotationsPropertyInfo )
110+ : base ( structuralType , updatableProperties , dynamicDictionaryPropertyInfo , isComplexType , instanceAnnotationsPropertyInfo )
111+ {
112+ DeltaKind = EdmDeltaEntityKind . DeletedEntry ;
113+ }
114+
115+ /// <inheritdoc />
116+ public Uri Id { get ; set ; }
117+
118+ /// <inheritdoc />
119+ public DeltaDeletedEntryReason ? Reason { get ; set ; }
120+
121+ /// <inheritdoc />
122+ public IEdmNavigationSource NavigationSource { get ; set ; }
123+ }
124+ }
0 commit comments