DotNetAnalyzers / AspNetCoreAnalyzers

MIT License
62 stars 4 forks source link

Use plural names in routes #12

Open JohanLarsson opened 5 years ago

JohanLarsson commented 5 years ago
[HttpGet(""api/orders/{id}"")]
public async Task<IActionResult> GetOrder(int ↓wrong)
{
    var match = await this.db.Orders.FirstOrDefaultAsync(x => x.Id == wrong);
    if (match == null)
    {
        return this.NotFound();
    }

    return this.Ok(match);
}

Check that orders is plural.

NinjaKitt3n commented 5 years ago

Order => Orders is fine but what about Goose => Geese or better yet Moose => Moose (Scissors => Scissors) or even Octopus => Octopi / Octopuses (both are valid pluralisations).

While the idea is good - implementation could potentially be a pain.

JohanLarsson commented 5 years ago

https://github.com/dotnet/roslyn-analyzers/issues/950