Вы можете создать Restful API с помощью Aspnet Boilerplate.Вот пример, чтобы показать вам, как это сделать.
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
для регенерации служебных прокси.