Reputation: 11
How to accept Verbs(Get) in ASP.NET Core dynamic web api?
Before
ABP(.NetFramework)
Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
.For<ITaskAppService>("tasksystem/task")
.ForMethod("GetTasks").WithVerb(HttpVerb.Get)
.Build();
New
ABP(ASP.NET Core)
I don't know how to use RemoteService attribute, do you have any example code?
I can't add Microsoft.AspNet.WebApi.Core to ABP 2.0.2 (ASP.NET Core), so I can't use [HttpGet].
Almost APIs use PostRequest, but need a little GetRequest for third-party. Thanks.
Ref: https://aspnetboilerplate.com/Pages/Documents/AspNet-Core#application-services-as-controllers
Upvotes: 0
Views: 1938
Reputation: 43098
Add Microsoft.AspNetCore.Mvc.Core
package instead.
using Microsoft.AspNetCore.Mvc.Core;
public class TaskAppService : ITaskAppService
{
[HttpGet]
public void MyMethod()
{
}
}
You should add the corresponding version of the package:
Upvotes: 1