Skip to content

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

5 participants