Skip to content

Conversation

JoanGil
Copy link
Contributor

@JoanGil JoanGil commented Sep 28, 2023

Summary

Fixes #9251

This pull request enhances the C# and VB language examples on the HttpUtility.ParseQueryString page. Following a discussion with @MichaelDeutschCoding, I've introduced two updated versions of the code to replace the outdated examples that did not adhere to clean code principles.

Thanks @gewarren and @carlossanlop for guiding me!

@JoanGil JoanGil requested review from a team and Rick-Anderson as code owners September 28, 2023 16:24
@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-System.Net.Http labels Sep 28, 2023
@ghost
Copy link

ghost commented Sep 28, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Summary

Fixes #9251

This pull request enhances the C# and VB language examples on the HttpUtility.ParseQueryString page. Following a discussion with @MichaelDeutschCoding, I've introduced two updated versions of the code to replace the outdated examples that did not adhere to clean code principles.

Thanks @gewarren and @carlossanlop for guiding me!

Author: JoanGil
Assignees: -
Labels:

area-System.Net.Http, community-contribution

Milestone: -

@JoanGil
Copy link
Contributor Author

JoanGil commented Sep 28, 2023

@dotnet-policy-service agree

@learn-build-service-prod

This comment was marked as outdated.

@JoanGil
Copy link
Contributor Author

JoanGil commented Oct 4, 2023

Hi @Rick-Anderson, @carlossanlop! Any news on this one?

@JoanGil
Copy link
Contributor Author

JoanGil commented Oct 30, 2023

Hi guys @Rick-Anderson, @carlossanlop. It's been a month with no response, could you take a look at this one? Some feedback would be really appreciated! 😁

@JoanGil
Copy link
Contributor Author

JoanGil commented Nov 7, 2023

File

Status

Preview URL

ms.author

ms.prod

ms.technology

ms.service

ms.subservice

Details

snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.aspx Succeeded n/a (file deleted or renamed) snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs Succeeded View snippets/visualbasic/VS_Snippets_WebNet/HttpUtility_ParseQueryString/vb/httputility_parsequerystring.aspx Succeeded n/a (file deleted or renamed) snippets/visualbasic/VS_Snippets_WebNet/HttpUtility_ParseQueryString/vb/httputility_parsequerystring.vb Succeeded View xml/System.Web/HttpUtility.xml Succeeded View

Is this something that I have to solve? Everything seems to be success and I don't have access to most of the files. Anything I can do?

@carlossanlop
Copy link
Contributor

Sorry for the late response.

@gewarren is the main contact for this repo, she can help review. @Rick-Anderson since you own System.Web, can you also please take a look?

Is this something that I have to solve? Everything seems to be success and I don't have access to most of the files. Anything I can do?

The CI passed, those are succeeded validation results, you don't need to do anything else for now. This now needs a code review.

@gewarren
Copy link
Contributor

gewarren commented Nov 7, 2023

@JoanGil The Try.NET snippet fails with these errors when I preview it in the browser (you won't have permissions to do that unfortunately):

program.cs(4,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code
program.cs(4,5): error CS0116: A namespace cannot directly contain members such as fields or methods
program.cs(5,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code
program.cs(5,5): error CS0116: A namespace cannot directly contain members such as fields or methods
program.cs(5,17): error CS0103: The name 'url' does not exist in the current context
program.cs(8,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code
program.cs(8,53): error CS0103: The name 'parsedUrl' does not exist in the current context
program.cs(11,1): error CS1022: Type or namespace definition, or end-of-file expected
program.cs(11,17): error CS8124: Tuple must contain at least two elements.
program.cs(11,17): error CS1026: ) expected
program.cs(11,17): error CS1022: Type or namespace definition, or end-of-file expected
program.cs(11,37): error CS0116: A namespace cannot directly contain members such as fields or methods
program.cs(11,44): error CS1022: Type or namespace definition, or end-of-file expected
program.cs(13,13): error CS0116: A namespace cannot directly contain members such as fields or methods
program.cs(13,23): error CS1031: Type expected
program.cs(13,23): error CS8124: Tuple must contain at least two elements.
program.cs(13,23): error CS1026: ) expected
program.cs(13,23): error CS1022: Type or namespace definition, or end-of-file expected
program.cs(14,1): error CS1022: Type or namespace definition, or end-of-file expected

@JoanGil
Copy link
Contributor Author

JoanGil commented Nov 8, 2023

@JoanGil The Try.NET snippet fails with these errors when I preview it in the browser (you won't have permissions to do that unfortunately):

program.cs(4,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code program.cs(4,5): error CS0116: A namespace cannot directly contain members such as fields or methods program.cs(5,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code program.cs(5,5): error CS0116: A namespace cannot directly contain members such as fields or methods program.cs(5,17): error CS0103: The name 'url' does not exist in the current context program.cs(8,1): error CS0825: The contextual keyword 'var' may only appear within a local variable declaration or in script code program.cs(8,53): error CS0103: The name 'parsedUrl' does not exist in the current context program.cs(11,1): error CS1022: Type or namespace definition, or end-of-file expected program.cs(11,17): error CS8124: Tuple must contain at least two elements. program.cs(11,17): error CS1026: ) expected program.cs(11,17): error CS1022: Type or namespace definition, or end-of-file expected program.cs(11,37): error CS0116: A namespace cannot directly contain members such as fields or methods program.cs(11,44): error CS1022: Type or namespace definition, or end-of-file expected program.cs(13,13): error CS0116: A namespace cannot directly contain members such as fields or methods program.cs(13,23): error CS1031: Type expected program.cs(13,23): error CS8124: Tuple must contain at least two elements. program.cs(13,23): error CS1026: ) expected program.cs(13,23): error CS1022: Type or namespace definition, or end-of-file expected program.cs(14,1): error CS1022: Type or namespace definition, or end-of-file expected

Okay, I have updated the code, wrapping it inside a Program and Main. Hopefully this will solve the C# and VB problems. Could you check again @gewarren. Thanks!

This comment was marked as outdated.

Copy link

Learn Build status updates of commit d4f906e:

✅ Validation status: passed

File Status Preview URL Details
snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.aspx ✅Succeeded n/a (file deleted or renamed)
snippets/csharp/VS_Snippets_WebNet/HttpUtility_ParseQueryString/cs/httputility_parsequerystring.cs ✅Succeeded View
snippets/visualbasic/VS_Snippets_WebNet/HttpUtility_ParseQueryString/vb/httputility_parsequerystring.aspx ✅Succeeded n/a (file deleted or renamed)
snippets/visualbasic/VS_Snippets_WebNet/HttpUtility_ParseQueryString/vb/httputility_parsequerystring.vb ✅Succeeded View
xml/System.Web/HttpUtility.xml ✅Succeeded View

For more details, please refer to the build report.

For any questions, please:

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works now; thanks @JoanGil!

@gewarren gewarren merged commit e7b23fc into dotnet:main Nov 8, 2023
@JoanGil JoanGil deleted the improve-http-utility-code-snippets branch November 9, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Web community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve HttpUtility.ParseQueryString formatting and code snipped for C#

4 participants