Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Aug 16, 2019
1 parent 1d15ad5 commit e9195e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Expand Up @@ -325,7 +325,9 @@ private object[] GetMappedValues()
{
_readerDataValues[i] = _xmlMap[i] switch
{
SqlXml => System.Data.SqlTypes.SqlXml.Null, // map strongly typed SqlString.Null to SqlXml.Null
// map strongly typed SqlString.Null to SqlXml.Null
SqlXml => System.Data.SqlTypes.SqlXml.Null,

_ => DBNull.Value,
};
}
Expand Down
2 changes: 2 additions & 0 deletions src/System.Data.Common/src/System/Xml/XPathNodePointer.cs
Expand Up @@ -703,13 +703,15 @@ private bool IsValidChild(XmlNode parent, XmlNode child)
(xntChildInt == (int)XPathNodeType.Element ||
xntChildInt == (int)XPathNodeType.Comment ||
xntChildInt == (int)XPathNodeType.ProcessingInstruction),

(int)XPathNodeType.Element =>
(xntChildInt == (int)XPathNodeType.Element ||
xntChildInt == (int)XPathNodeType.Text ||
xntChildInt == (int)XPathNodeType.Comment ||
xntChildInt == (int)XPathNodeType.Whitespace ||
xntChildInt == (int)XPathNodeType.SignificantWhitespace ||
xntChildInt == (int)XPathNodeType.ProcessingInstruction),

_ => false,
};
}
Expand Down
1 change: 1 addition & 0 deletions src/System.Data.Common/src/System/Xml/XmlDataDocument.cs
Expand Up @@ -1060,6 +1060,7 @@ dp.NodeType switch
XmlNodeType.Comment => CreateComment(dp.Value),
XmlNodeType.Whitespace => CreateWhitespace(dp.Value),
XmlNodeType.SignificantWhitespace => CreateSignificantWhitespace(dp.Value),

//for the nodes that don't have values, but might have children -- only clone the node and leave the children untouched
XmlNodeType.Element => CreateElement(dp.Prefix, dp.LocalName, dp.NamespaceURI),
XmlNodeType.Attribute => CreateAttribute(dp.Prefix, dp.LocalName, dp.NamespaceURI),
Expand Down
Expand Up @@ -98,8 +98,12 @@ public sealed override SubjectIdentifierOrKey OriginatorIdentifierOrKey
CMsgKeyAgreeOriginatorChoice originatorChoice = recipient->dwOriginatorChoice;
return originatorChoice switch
{
CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_CERT => recipient->OriginatorCertId.ToSubjectIdentifierOrKey(),
CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY => recipient->OriginatorPublicKeyInfo.ToSubjectIdentifierOrKey(),
CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_CERT =>
recipient->OriginatorCertId.ToSubjectIdentifierOrKey(),

CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY =>
recipient->OriginatorPublicKeyInfo.ToSubjectIdentifierOrKey(),

_ => throw new CryptographicException(SR.Format(SR.Cryptography_Cms_Invalid_Originator_Identifier_Choice, originatorChoice)),
};
});
Expand Down

0 comments on commit e9195e8

Please sign in to comment.