/
EdmDeltaDeletedLink.cs
100 lines (91 loc) · 3.03 KB
/
EdmDeltaDeletedLink.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//-----------------------------------------------------------------------------
// <copyright file="EdmDeltaDeletedLink.cs" company=".NET Foundation">
// Copyright (c) .NET Foundation and Contributors. All rights reserved.
// See License.txt in the project root for license information.
// </copyright>
//------------------------------------------------------------------------------
using System;
using Microsoft.OData.Edm;
namespace Microsoft.AspNet.OData
{
/// <summary>
/// Represents an <see cref="IEdmDeltaDeletedLink"/> with no backing CLR <see cref="Type"/>.
/// Used to hold the Deleted Link object in the Delta Feed Payload.
/// </summary>
[NonValidatingParameterBinding]
public class EdmDeltaDeletedLink : EdmEntityObject, IEdmDeltaDeletedLink
{
private Uri _source;
private Uri _target;
private string _relationship;
/// <summary>
/// Initializes a new instance of the <see cref="EdmDeltaDeletedLink"/> class.
/// </summary>
/// <param name="entityType">The <see cref="IEdmEntityType"/> of this DeltaDeletedLink.</param>
public EdmDeltaDeletedLink(IEdmEntityType entityType)
: this(entityType, isNullable: false)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="EdmDeltaDeletedLink"/> class.
/// </summary>
/// <param name="entityTypeReference">The <see cref="IEdmEntityTypeReference"/> of this DeltaDeletedLink.</param>
public EdmDeltaDeletedLink(IEdmEntityTypeReference entityTypeReference)
: this(entityTypeReference.EntityDefinition(), entityTypeReference.IsNullable)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="EdmDeltaDeletedLink"/> class.
/// </summary>
/// <param name="entityType">The <see cref="IEdmEntityType"/> of this DeltaDeletedLink.</param>
/// <param name="isNullable">true if this object can be nullable; otherwise, false.</param>
public EdmDeltaDeletedLink(IEdmEntityType entityType, bool isNullable)
: base(entityType, isNullable)
{
}
/// <inheritdoc />
public Uri Source
{
get
{
return _source;
}
set
{
_source = value;
}
}
/// <inheritdoc />
public Uri Target
{
get
{
return _target;
}
set
{
_target = value;
}
}
/// <inheritdoc />
public string Relationship
{
get
{
return _relationship;
}
set
{
_relationship = value;
}
}
/// <inheritdoc />
public override EdmDeltaEntityKind DeltaKind
{
get
{
return EdmDeltaEntityKind.DeletedLinkEntry;
}
}
}
}