Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Routing (Get(int id)) has been broken in latest RC2 #233

@xatabhk

Description

@xatabhk

routing_bug_byid
It seems routing has been broken in latest RC2. When the following controller is run on RC2, method 'Get(int id)' receives no hit. If you enter 'http://localhost:9941/api/values/1' or the like in Edge or IE, it reports error 404.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Mvc;

namespace tbweb.Controllers
{
    [Route("api/[controller]")]
    public class ValuesController : Controller
    {
        // GET: api/values
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/values/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }

        // POST api/values
        [HttpPost]
        public void Post([FromBody]string value)
        {
        }

        [HttpPost("{asfile:bool}")]
        public ActionResult Post(bool asfile, [FromBody]string sRegData)
        {
            return new ObjectResult("xyx");
        }
    }
}

If we remove method 'Post(bool asfile, [FromBody]string sRegData)', 'Get(int id)' will get hits as usual.

I think this is a bug introduced in latest RC2 because I can run the above controller on RC1 final and RC2 weeks ago without any issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions