Add async XLinq document/element loading and saving#14774
Add async XLinq document/element loading and saving#14774sepidehkh merged 1 commit intodotnet:masterfrom
Conversation
6d3c879 to
1257e2d
Compare
| public override Task WriteToAsync(XmlWriter writer, CancellationToken cancellationToken) | ||
| { | ||
| if (writer == null) | ||
| throw new ArgumentNullException("writer"); |
There was a problem hiding this comment.
Nit: nameof(writer) (I think we switched over to using nameof throughout after these changes were already checked-in to the future branch). Applies to a few other files in this PR.
| @@ -0,0 +1,205 @@ | |||
| // Copyright (c) Microsoft. All rights reserved. | |||
| // Licensed under the MIT license. See LICENSE file in the project root for full license information. | |||
There was a problem hiding this comment.
This should be replaced with the new license header
| public XCData(System.Xml.Linq.XCData other) : base(default(string)) { } | ||
| public override System.Xml.XmlNodeType NodeType { get { throw null; } } | ||
| public override void WriteTo(System.Xml.XmlWriter writer) { } | ||
| public override System.Threading.Tasks.Task WriteToAsync(System.Xml.XmlWriter writer, System.Threading.CancellationToken cancellationToken) { throw null; } |
1257e2d to
18c59b5
Compare
|
@justinvp Thanks for your comments. Made according changes. |
18c59b5 to
318ede2
Compare
| public static System.Xml.Linq.XDocument Load(System.Xml.XmlReader reader) { throw null; } | ||
| public static System.Xml.Linq.XDocument Load(System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) { throw null; } | ||
| #if netcoreapp11 | ||
| public static System.Threading.Tasks.Task<System.Xml.Linq.XDocument> LoadAsync(System.IO.Stream stream, System.Xml.Linq.LoadOptions options, System.Threading.CancellationToken cancellationToken) { throw null; } |
There was a problem hiding this comment.
do you know why we don't put 'async' keyword in the ref file? (not your change)
There was a problem hiding this comment.
That would create another private type for the state machine that isn't necessary.
danmoseley
left a comment
There was a problem hiding this comment.
Examined the diffs and I believe this is an accurate port. I'll not merge in case one of the other guys want to look.
|
Any additional comments? |
|
I'll take a look today... |
stephentoub
left a comment
There was a problem hiding this comment.
Looks like a faithful port; thanks.
If you haven't already, you might want to diff the current XLinq code against the XLing code from the future branch to see if anything else changed that could impact this. The async code was derived from the sync code, so if the sync code has changed in the interim (e.g. if anything got modified/augmenting as part of bringing back more APIs), the async code may need to as well. I don't know if there are any such cases, though.
|
Thanks for reviewing. |
…adSave Add async XLinq document/element loading and saving Commit migrated from dotnet/corefx@b119ec5
This PR resolves https://github.com/dotnet/corefx/issues/2869. Merges #2436 from future branch into master and exposes the new APIs for netcoreapp1.1.
@danmosemsft @stephentoub @weshaggard