DotNetAnalyzers / AspNetCoreAnalyzers

MIT License
62 stars 4 forks source link

Route parameter default value must match type #42

Open JohanLarsson opened 5 years ago

JohanLarsson commented 5 years ago
namespace AspBox.Controllers
{
    using System.Collections.Generic;
    using Microsoft.AspNetCore.Mvc;

    [ApiController]
    public class ValuesController : ControllerBase
    {
        [HttpGet("api/items/{id=abc}")]
        public ActionResult<string> Get(int id)
        {
            return $"'{id.ToString()}'";
        }
    }
}