-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HasExplicitODataId to ODataResourceBase #2620
base: release-7.x
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,6 +213,14 @@ public ICollection<ODataInstanceAnnotation> InstanceAnnotations | |
set { this.SetInstanceAnnotations(value); } | ||
} | ||
|
||
/// <summary>Gets or sets the value that shows if the resource has @odata.id or @id.</summary> | ||
/// <returns>true if the resource has @odata.id or @id, false otherwise.</returns> | ||
public bool HasExplicitODataId | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
{ | ||
get; | ||
internal set; | ||
} | ||
|
||
/// <summary> | ||
/// The metadata builder for this OData resource. | ||
/// </summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Microsoft.OData.ODataResourceBase.HasExplicitODataId.get -> bool |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Microsoft.OData.ODataResourceBase.HasExplicitODataId.get -> bool |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Microsoft.OData.ODataResourceBase.HasExplicitODataId.get -> bool |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Microsoft.OData.ODataResourceBase.HasExplicitODataId.get -> bool |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,10 +70,11 @@ public void ReadBasicSingletonTest() | |
Assert.Equal(2, entry.Properties.Count()); | ||
Assert.Equal(10, entry.Properties.Single(p => p.Name == "WebId").Value); | ||
Assert.Equal("SingletonWeb", entry.Properties.Single(p => p.Name == "Name").Value); | ||
Assert.False(entry.HasExplicitODataId); | ||
} | ||
|
||
[Fact] | ||
public void ReadSingletonWithIdSpecifiedTest() | ||
public void ReadSingletonWithODataIdSpecifiedTest() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check line 81 |
||
{ | ||
const string payload = "{" + | ||
"\"@odata.context\":\"http://odata.org/test/$metadata#MySingleton\"," + | ||
|
@@ -86,6 +87,7 @@ public void ReadSingletonWithIdSpecifiedTest() | |
Assert.Equal(new Uri("http://odata.org/test/Bla"), entry.Id); | ||
Assert.Equal(new Uri("http://odata.org/test/BlaBla"), entry.EditLink); | ||
Assert.Equal(new Uri("http://odata.org/test/BlaBlaBla"), entry.ReadLink); | ||
Assert.True(entry.HasExplicitODataId); | ||
} | ||
|
||
[Fact] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
internal set? or totally as internal property?
Change "Gets or sets" for Internal set