Skip to content

Conversation

@ugumba
Copy link

@ugumba ugumba commented Jan 20, 2020

Got something working for ASP.NET Core 3.x (see #25).
I don't like the redirect. The browser's address bar shows the "internal" route, which is different from the original.
Can anyone suggest a better way to accomplish this?

Packaging and docs have not been updated yet.

@kingrichard2005
Copy link

kingrichard2005 commented Jul 23, 2021

See previous issue comment for details but consider removing references to HttpMethodActionConstraint since it's no longer publicly accessible in net 3+. Can replace with the following to get the same httpmethod metadata from the public EndpointMetadata property instead


	var httpMethodMetadata = _e.EndpointMetadata.Where(obj => obj is HttpMethodMetadata).FirstOrDefault();

	if (httpMethodMetadata != null)
	{
		var verbMethod = (httpMethodMetadata as HttpMethodMetadata).HttpMethods.FirstOrDefault();
		verb = verbMethod == null ? verb : verbMethod;
	}

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.

2 participants