Ridge
Ridge copied to clipboard
Controllers and actions with same methods
Controllers and actions with same name are currently not supported. Folowing example will fail
namespace TestWebApplication.Controllers
{
[GenerateClient]
[Route("SameName1")]
public class ControllersWithSameName
{
[HttpGet]
public int AndWithSameMethod()
{
return 1;
}
}
}
namespace TestWebApplication.Controllers2
{
[GenerateClient]
[Route("SameName2")]
public class ControllersWithSameName
{
[HttpGet]
public int AndWithSameMethod()
{
return 2;
}
}
}
With error: 16>CSC: Error CS8785 : Generator 'ControllerClientGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'ControllersWithSameName_Client.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'.
Controllers in separate assemblies with same name will compile but routing is incorrect.