Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require type constraints? #63

Open
JohanLarsson opened this issue Jan 24, 2019 · 1 comment
Open

Require type constraints? #63

JohanLarsson opened this issue Jan 24, 2019 · 1 comment

Comments

@JohanLarsson
Copy link
Collaborator

Before:

namespace AspBox
{
    using Microsoft.AspNetCore.Mvc;

    [Route("api/values")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        [HttpGet("{id}")]
        public IActionResult Get(int id)
        {
            ...
        }
    }
}

After:

namespace AspBox
{
    using Microsoft.AspNetCore.Mvc;

    [Route("api/values")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        [HttpGet("{id:int}")]
        public IActionResult Get(int id)
        {
            ...
        }
    }
}
@JohanLarsson JohanLarsson added the question Further information is requested label Jan 24, 2019
@lloydjatkinson
Copy link

This is a good idea

@JohanLarsson JohanLarsson added analyzer codefix and removed question Further information is requested labels Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants