aspnet / Mvc

[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[pubinternal] QueryCollection

MarcusKohnert opened this issue · comments

Description of the problem: #8689

Microsoft.AspNetCore.Http.Internal.QueryCollection

Use case:

In UnitTests we instantiate concrete objects of type QueryCollection to assign those instances to httpContext.Request.Query to establish a test context.

httpContext.Request.Query = new QueryCollection(new Dictionary<string, StringValues>
{
	{ "key1", "value1" },
	{ "key2", "value2" }
})

Does the pubternal effort extend beyond the MVC packages?

Not that I know of. @MarcusKohnert the type's not in one of the namespaces listed in the linked issue, there are no current plans to change it's pubternal status.

👍 alright. Sorry for the confusion. Only searched for .Internal in our code base. Is this pubinternal thing a common pattern? I've never heard about it before. Will keep an eye out in the future.

It's common in our code base. I haven't seen it elsewhere.