Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sreejithpin committed Jun 2, 2021
1 parent b764571 commit f9f672d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Microsoft.AspNet.OData.Shared/DeltaSetOfT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ internal DeltaSet<TStructuralType> CopyChangedValues(PatchMethodHandler<TStructu

DeltaDeletedEntityObject<TStructuralType> deletedObj = changedObj as DeltaDeletedEntityObject<TStructuralType>;

if (deletedObj != null || patchStatus == PatchStatus.Failure)
if (patchStatus == PatchStatus.Failure || (deletedObj != null && patchStatus == PatchStatus.NotFound))
{
IDeltaSetItem deltaSetItem = changedObj;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ public ITestActionResult PatchUnTypedFriends(int key, [FromBody] EdmChangedObjec
}
}



return Ok(changedObjColl);
}
else if(key ==2)
Expand All @@ -310,12 +308,12 @@ public ITestActionResult PatchUnTypedFriends(int key, [FromBody] EdmChangedObjec

var friendCollection = new FriendColl<IEdmStructuredObject>() { entity };

var changedObjColl = friendColl.Patch(new EmployeeEdmPatchHandler(entitytype));
var changedObjColl = PatchWithUsersMethodTypeLess(key, friendColl);

object obj;
Assert.Single(friendCollection);
Assert.Single(changedObjColl);

friendCollection.First().TryGetPropertyValue("Age", out obj);
changedObjColl.First().TryGetPropertyValue("Age", out obj);
Assert.Equal(35, obj);

return Ok(changedObjColl);
Expand Down

0 comments on commit f9f672d

Please sign in to comment.