Use of feature routing

//[RoutePrefix(" API /Values/")]// [Route("~ API /Values/{id:int}")] [Route("~ API /Values/{id:int}")]
public class ValuesController : ApiController
{
	// GET api/values
  	//1. The Method matching the request
     / / 2. Match the HttpGet
     //3. Match parameters
     // Feature routing: has the highest priority, bypassing the default Api routing;
     // Attribute routing: optionally specify the URL of our request Api
    // GET api/values
    [HttpGet]
    public IEnumerable<string> LGet()
    {
        return new string[] { "value1"."value2" };
    }

    // GET api/values/5
    [Route("api/Values/{id:int}")]/ / regex ()
    [HttpGet]
    public string GetById(int id)/ / Id query
    {
        return "value";
    }

    / / / the Route (" API/Values / {id: int = 10} ")] / / can be empty
    / / [Route (" API/Values / {id: int?} ")] / / can be empty
    Public string GetId(int ID = 10)//Id query
    / / {
    // return "value";
    / /}

    /// <summary>
    ///Get value--value has child table data --
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    [Route("api/Values/{id:int}/Type/{typeId:int}")]
    public string Get(int id, int typeId)/ / Id query
    {
        return $"value-Type {id} {typeId}";
    }

    [Route("api/Values/{name}")]
    public string Get(string name)// Name query
    {
        return $"value {name}";
    }

    [Route("api/Values/{id}/V2")]
    [HttpGet]
    public string LGetV333455(int id)
    {
        return "value V2";
    }

    // POST api/values
    public void Post([FromBody]string value){}// PUT api/values/5
    public void Put(int id, [FromBody]string value){}// DELETE api/values/5
    public void Delete(int id){}}Copy the code