dotnet / dotnet/aspnetcore

Consider adding implicit conversions to/from string to HostString, QueryString and FragmentString

Open
#28,891 1 comment 0 reactions 0 assignees View on GitHub
area-networking design-proposal
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

## Summary

`HostString` should have implicit conversions to and from `string`.

## Motivation and goals

`PathString` have implicit conversions to and from `string`.

I've found [code](https://github.com/dotnet/aspnetcore/blob/b795ac3546eb3e2f47a01a64feb3020794ca33bb/src/Middleware/Rewrite/src/RedirectToHttpsRule.cs#L33) that is boxing `HostSTring` and `QueryString`. The developer, probably, though that the implicit conversion existed.

# Detailed design

Implement the conversions like implemented for `PathString`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.