question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DynamicApiControllerBuilder in .netcore

See original GitHub issue

Does Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder exist in .netcore version? I would like to override the abp.services.app.my_appservice syntax to abp.services.my_namespace.my_appservice.

MyProject.Applications.TimeClock.ScheduleAppService => abp.services.timeclock.schedule. Recursivesly if possible…

MyProject.Applications.TimeClock.Store1.ScheduleAppService => abp.services.timeclock.store1.schedule. MyProject.Applications.TimeClock.Store2.ScheduleAppService => abp.services.timeclock.store2.schedule.

The content here seems to be out of date.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ismcagdascommented, Dec 1, 2020

@multinerd you can filter types by using a Where predicate after Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices. For example

Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(...).Where(type => ...)

0reactions
multinerdcommented, Dec 4, 2020

The syntax feels a bit weird.

Personally, I would think I apply my where predicate prior to creating the controllers, not after.

current solution for future readers.


public interface IPortalApplicationServiceBase : IApplicationService // Core tables like Users, Roles, etc...
{
}

public interface ITimeClockAppServiceBase : IApplicationService
{
}
Configuration.Modules.AbpAspNetCore()
		.CreateControllersForAppServices(typeof(PortalApplicationModule).GetAssembly())
		.Where(type => typeof(IPortalApplicationServiceBase).IsAssignableFrom(type));

Configuration.Modules.AbpAspNetCore()
		.CreateControllersForAppServices(typeof(PortalApplicationModule).GetAssembly(), "app.timeclock")
		.Where(type => typeof(ITimeClockAppServiceBase).IsAssignableFrom(type));
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to dynamically add a controller in a ASP.NET Core 6 ...
I need to dynamically creates controllers in a ASP.NET Core 6 MVC application. I found some way to somewhat achieve this but not...
Read more >
Building Dynamic Web API Controllers
Building Dynamic Web API Controllers. This document is for the ASP.NET Web API. If you're interested in ASP.NET Core, see the ASP.NET Core...
Read more >
Generic and dynamically generated controllers in ASP.NET ...
Generic and dynamically generated controllers in ASP.NET Core MVC ... NET Core wouldn't consider BaseController as a valid controller.
Read more >
Building Dynamic Web API Controllers
Building Dynamic Web API Controllers. This document is for ASP.NET Web API. If you're interested in ASP.NET Core, see ASP.NET Core documentation.
Read more >
Dynamic Route in ASP.NET Core When ...
There is a way to dynamically change matched route before it's handled. This is done by MapDynamicControllerRoute() . public void Configure( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found