You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following class is a valid class based on the attached editorconfig.txt
using Microsoft.AspNetCore.Mvc;
namespace Web.Controllers;
[Route("test")]
public class TestController : ControllerBase
{
private readonly ILogger<TestController> logger;
public TestController(ILogger<TestController> logger)
{
this.logger = logger;
}
[HttpPost("test/{id}")]
public ActionResult Test(string id)
{
this.logger.LogInformation("Hello {Id}", id);
return this.Ok("Format me");
}
}
When I run dotnet dotnet-format the file is formatted as follows:
After some time digging into the problem I realized that changing the primary constructor to a regular constructor fixes the issue. And dotnet-format will not format wrongly the file.
The text was updated successfully, but these errors were encountered:
dotnet dotnet-format
the file is formatted as follows:dotnet-format
will not format wrongly the file.The text was updated successfully, but these errors were encountered: