Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

请问服务接口实现应该如何使用依赖注入? #7

Closed
NepPure opened this issue Apr 10, 2019 · 5 comments
Closed

请问服务接口实现应该如何使用依赖注入? #7

NepPure opened this issue Apr 10, 2019 · 5 comments
Assignees
Labels
需要帮助 需要开发人员协助。

Comments

@NepPure
Copy link

NepPure commented Apr 10, 2019

3.1.5 实现提供的服务接口

public class MyService : ServiceBase<IMyService>,IMyService
{
    public UnaryResult<int> CalculateNumber(int x,int y)
    {
        return UnaryResult(x + y);
    }
}

关于实现服务接口,请问这里怎样才能使用ABP的依赖注入系统?
调用时的服务实例创建并没有被依赖注入容器管理,
IocManager.Instance.Resolve可用,但是对单元测试不友好,不知大佬是否有更好的办法?

@real-zony real-zony added the 需要帮助 需要开发人员协助。 label Apr 10, 2019
@real-zony real-zony self-assigned this Apr 10, 2019
@real-zony
Copy link
Owner

@NepPure 该问题取决于 MagicOnion 作者这边的进度,因为需要更改其底层代码。现在该作者已经正在实现依赖注入功能,在 MagicOnion 库支持之后,我这边会立即更新的。

参考 Issue: Cysharp/MagicOnion#64

@NepPure
Copy link
Author

NepPure commented Apr 10, 2019

@GameBelial 感谢解答

@NepPure NepPure closed this as completed Apr 10, 2019
@NepPure
Copy link
Author

NepPure commented May 15, 2019

@GameBelial MagicOnion已经更新啦

@NepPure NepPure reopened this May 15, 2019
@real-zony
Copy link
Owner

@NepPure 好的,这边会跟进。

@real-zony
Copy link
Owner

@NepPure 50962a7 已经集成依赖注入,请直接更新包版本即可.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
需要帮助 需要开发人员协助。
Projects
None yet
Development

No branches or pull requests

2 participants