-
Notifications
You must be signed in to change notification settings - Fork 924
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
两个服务之间该怎么调用呢? #39
Comments
this.GetService<IUser2Service>().GetUserName(123); 如果是远程调用就引用接口,如果是本地调用就要引用模块的领域服务和接口了。订单服务还需要添加 |
代码实现:
` |
this.GetService<IUser2Service>().GetUserName(123); 这个方法就可以了,不需要创建代理,会自动判断是否远程调用 |
[ServiceBundle("api/{Service}")]
|
option.AddRelateService();添加了吗 |
|
错误信息贴出来 |
不支持直接返回string,请用Task |
刚才那个问题解决了,我接口的返回都改成了task,但是又有一个新的问题 下面是接口的声明
下面是通过引用查看看到的临时文件内容 |
var result = this.GetService().GetMembers(10).Result; 用这个调用本服务是可以的,但是如何调用其他服务的接口呢?
例如我有两个服务一个订单服务,一个库存服务,我要在订单的服务中调用库存的服务,订单服务是不是需要引用订单服务中定义的接口库?
The text was updated successfully, but these errors were encountered: