-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有办法实现动态控制器并路由吗? #38
Comments
我的意思是控制器本身也是动态的. |
控制器可以是动态的,你生成控制器类之后注册进去就行了。 |
首页的动图就是展示的这个操作,如果打不开需要自己改一下HOST |
首页的动态那效果有DEMO代码吗? |
就是我发的那个链接,是 core31WebAPi 项目 |
好的,谢谢 |
你给的Demo好像没有用//仅仅注册组件 |
另外这种方式能用在mvc上吗? |
使用最新版 Natasha 例子没有更新。 MVC 上没做过调研,理论上可以使用。因为 MVC 组件要比 API 组件要多。 |
我先试下看看 |
嗯,这个需要把注册的实例保留,在添加动态路由的时候再注册一下。 |
具体应该怎么写代码的? |
请提供更多的信息,startup.cs 和 TestController |
程序代码可以打包发我邮箱 2765968624@qq.com |
TestController就是demo里的,其他的代码就是默认有使用autofac的这种,现在手上的项目框架太大了,不方便发。 |
嗯 |
能解决了麻烦在这里回复一下。 |
这个属于 Autofac 的问题,如果您着急使用请先联系 Autofac 的团队询问。 |
多谢张老师, 不过新版里貌似没有ScriptHelper,是有什么新的替代吗?还是需要我参考老版代码手动实现一下?我是.net6的项目 |
获取类名的工具类而已,自己实现一个就行,名字没有特殊用法,随便取。 |
有办法实现动态控制器并路由吗?
The text was updated successfully, but these errors were encountered: