Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose extension methods to wrap and unwrap adapters #353

Merged
merged 17 commits into from
Oct 31, 2023

Conversation

twsouthwick
Copy link
Member

@twsouthwick twsouthwick commented Jun 8, 2023

As it currently stands, we only support using casting to convert between the two representations. This change exposes the extension methods we are using internally to expose the ASP.NET Core or System.Web objects.

Fixes dotnet/aspnetcore#51119

@twsouthwick
Copy link
Member Author

@davidfowl Here are the extension methods. I'm not happy with the name, though, as it feels fairly generic (but maybe sufficient?).

@joperezr joperezr added this to the 1.3 milestone Jun 28, 2023
@twsouthwick twsouthwick marked this pull request as draft October 10, 2023 20:24
@twsouthwick twsouthwick marked this pull request as ready for review October 26, 2023 23:06
@twsouthwick twsouthwick requested a review from Tratcher October 31, 2023 15:54
Comment on lines 78 to 85
public static HttpResponseCore AsAspNetCore(this HttpResponse response)
{
ArgumentNullException.ThrowIfNull(response);

return response;
}

internal static HttpContextBase AsSystemWebBase(this HttpContextCore context)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can you put the AsAspNetCore ones first so that the AsSystemWeb ones can be together, even if the last one is internal?

@twsouthwick twsouthwick merged commit a488c3f into main Oct 31, 2023
@twsouthwick twsouthwick deleted the tasou/add-extension-methods-to-unwrap branch October 31, 2023 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Web adapter API to convert between ASP.NET Core and System.Web types
4 participants