Skip to content
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

Given 允许返回一个闭包 #98

Closed
ymh199478 opened this issue Dec 4, 2018 · 0 comments
Closed

Given 允许返回一个闭包 #98

ymh199478 opened this issue Dec 4, 2018 · 0 comments
Labels

Comments

@ymh199478
Copy link
Contributor

ymh199478 commented Dec 4, 2018

上下文关系允许传入一个闭包来解决上下文。

container.Bind<MyClass>().Needs<IInterface>().Given(()=>{
      return new InterfaceClass();
});

这对于一些需要从管理器中获取接口实现的类非常有用。

ymh199478 added a commit that referenced this issue Dec 4, 2018
@ymh199478 ymh199478 added the 1.3 label Dec 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant