AspnetBoilerplate REST 网址

AspnetBoilerpate REST Urls

在查看文档和 github 问题后,我找不到创建 RESTful api 的方法。如果我们想要 RESTful.

,它仅指使用标准 webapi 实现

是否有替代方法(无需完成重写当前 webapi 实现)来获取 api 的 RESTful 并同时让服务代理工作和那些?

您可以使用 Aspnet 样板创建 Restful API。这是一个向您展示如何操作的示例。

public class TestAppService : SwagResterAppServiceBase, ITestAppService
{
    [Route("api/services/app/Test")]
    [HttpPost]
    public Task CreateTest(TestDetailsDto input)
    {
        throw new NotImplementedException();
    }

    [Route("api/services/app/Test")]
    [HttpDelete]
    public Task DeleteTest(EntityDto input)
    {
        throw new NotImplementedException();
    }

    [Route("api/services/app/Test")]
    [HttpGet]
    public Task GetTest(EntityDto input)
    {
        throw new NotImplementedException();
    }

    [Route("api/services/app/Test")]
    [HttpPut]
    public Task UpdateTest(TestDetailsDto input)
    {
        throw new NotImplementedException();
    }
}

public interface ITestAppService: IApplicationService, ITransientDependency
{

    Task CreateTest(TestDetailsDto input);


    Task DeleteTest(EntityDto input);


    Task GetTest(EntityDto input);


    Task UpdateTest(TestDetailsDto input);
}

public class TestDetailsDto
{

}

然后 运行 refresh.bat 重新生成服务代理。