Open belav opened 2 years ago
real world example
if (
parameterCustomAttributes.OfType<IFromRouteMetadata>().FirstOrDefault() is
{ } routeAttribute
) {
make sure to test with
if (
context.ActionDescriptor is ControllerActionDescriptor
{
ActionName: "Post" or "Patch" or "Delete"
}
) { }
if (
context.ActionDescriptor is ControllerActionDescriptor
{
ActionName: "MuchLongerStringValue"
or "MuchLongerStringValue"
or "MuchLongerStringValue"
}
) { }
The following
Is more readable as