为自定义 ApplicationService 创建动态 JavaScript 代理
Creating dynamic JavaScript proxy for custom ApplicationService
我已经阅读了 ABP 文档。
这是我基于ABP框架的新项目的解决方案架构。
首先想问下这个设计有没有问题?
我已经在 Holitera.ApplicationModule
中将所有应用程序服务注册到 IocManager
。
所以现在我可以从 MVC 控制器调用我的应用程序服务。 RegionAppService
是我的新 AppService。
这里是注册:
还有我的RegionAppService
class:
public class RegionAppService : AsyncCrudAppService<Region, RegionDto,int>, IRegionAppService
{
private readonly IRepository<Region> _regionRepository;
public RegionAppService(IRepository<Region> regionRepository) :
base(regionRepository)
{
CreatePermissionName = "CreateRegionPermission";
_regionRepository = regionRepository;
}
}
现在我想创建一个 CRUD Razor 页面,就像默认模板中的角色视图一样。但是我无法将我的自定义 RegionAppService
注册到 JavaScript 代理服务。
我需要一个动态 Web API 模块来做到这一点吗?那有必要吗?如果是,那么 Role、User、Customer、Account 服务如何注册到动态 JS 代理?我找不到那个配置。据我所知,默认 MVC 模板中没有动态 Web API 模块的配置?所以我还没有 API 模块。
我稍后需要动态 JavaScript 模块,但不是现在。首先,我只想处理这个。
另外,动态AJAX 调用方法和动态Web API 模块有什么区别?它们是相同的还是不同的?
谢谢:)
anything wrong with this design?
Entity 和 DomainService 进入核心项目。 Dto 和 AppService 进入应用程序项目。
您可以阅读有关 NLayer Architecture.
的内容
这是发现其他服务的方式,也是正确的方法。
Do i need dynamic web api module to do that? Is that neccessary?
没有
how are Role, User, Customer, Account services are registered to dynamic js proxy? I couldn't find the configuration for that. As much as i know there is no configuration for dynamic api module in default mvc template?
已在 YourProjectNameWebCoreModule 中完成。您可以为其他程序集创建控制器:
Configuration.Modules.AbpAspNetCore()
.CreateControllersForAppServices(
typeof(RegionAppService).GetAssembly()
);
我已经阅读了 ABP 文档。
这是我基于ABP框架的新项目的解决方案架构。 首先想问下这个设计有没有问题?
我已经在 Holitera.ApplicationModule
中将所有应用程序服务注册到 IocManager
。
所以现在我可以从 MVC 控制器调用我的应用程序服务。 RegionAppService
是我的新 AppService。
这里是注册:
还有我的RegionAppService
class:
public class RegionAppService : AsyncCrudAppService<Region, RegionDto,int>, IRegionAppService
{
private readonly IRepository<Region> _regionRepository;
public RegionAppService(IRepository<Region> regionRepository) :
base(regionRepository)
{
CreatePermissionName = "CreateRegionPermission";
_regionRepository = regionRepository;
}
}
现在我想创建一个 CRUD Razor 页面,就像默认模板中的角色视图一样。但是我无法将我的自定义 RegionAppService
注册到 JavaScript 代理服务。
我需要一个动态 Web API 模块来做到这一点吗?那有必要吗?如果是,那么 Role、User、Customer、Account 服务如何注册到动态 JS 代理?我找不到那个配置。据我所知,默认 MVC 模板中没有动态 Web API 模块的配置?所以我还没有 API 模块。
我稍后需要动态 JavaScript 模块,但不是现在。首先,我只想处理这个。
另外,动态AJAX 调用方法和动态Web API 模块有什么区别?它们是相同的还是不同的?
谢谢:)
anything wrong with this design?
Entity 和 DomainService 进入核心项目。 Dto 和 AppService 进入应用程序项目。
您可以阅读有关 NLayer Architecture.
这是发现其他服务的方式,也是正确的方法。
Do i need dynamic web api module to do that? Is that neccessary?
没有
how are Role, User, Customer, Account services are registered to dynamic js proxy? I couldn't find the configuration for that. As much as i know there is no configuration for dynamic api module in default mvc template?
已在 YourProjectNameWebCoreModule 中完成。您可以为其他程序集创建控制器:
Configuration.Modules.AbpAspNetCore()
.CreateControllersForAppServices(
typeof(RegionAppService).GetAssembly()
);