Hi support,
I am currently upgrading to WiseJ-3 and hence to .NET 6.0 asp.net core.
My application currently provides both UI and API server functionality. So url/ returns the WiseJ SPA, whereas url/api routes to the API services. The following snippet represents the working coal face:
using Newtonsoft.Json.Linq;
public class MainController : ApiController
{
[Route(“api/ping”)] [HttpGet] public JObject Ping() => JObject.Parse(“{Message: ‘” + HttpContext.Current.Request.HttpMethod + “‘}”);
}
This works in conjunction with Global.asax.cs: Application_Start {GlobalConfiguration.Configure(MainConfig.Register);} which in turn configures config.Routes.MapHttpRoute(routeTemplate: “api/{controller}/{id}”);
.NET 6.0 asp.net core no longer supports ApiController, so I have converted to AspNetCore.Mvc.ControllerBase.
.NET 6.0 asp.net core also no longer supports Global.asax.cs or GlobalConfiguration.Configure, and this is where I am stuck. I cannot work out how to register correctly to utilise MainController for url/api/[etc].
Would you be able to supply a minimal example project for the new WiseJ-3 release and .NET 6.0 asp.net core that provides normal WiseJ UI (Page1.cs) on the root URL along with rest API services at /api/.
Many thanks in advance.
Neil.
Hi Neil
This kind of question sadly is outside of the scope of help that we provide in the forum.
This info can help you to go in the right direction
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/routing?view=aspnetcore-6.0
Also we can provide proffesional services for specific advanced request, in 4h support packages
Here the link for contact us
Thanks and regards
Please login first to submit.