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

看什么时候方便支持一下IOC等功能 #7

Closed
flyliao opened this issue Nov 8, 2018 · 1 comment
Closed

看什么时候方便支持一下IOC等功能 #7

flyliao opened this issue Nov 8, 2018 · 1 comment

Comments

@flyliao
Copy link

flyliao commented Nov 8, 2018

 看什么时候支持这种依赖注入,以前很多项目可能就会无缝切换到FastHttpApi上面来
    /// <summary>
    ///     IoC 初始化
    /// </summary>
    /// <param name="services"></param>
    /// <returns></returns>
    private IServiceProvider InitIoC(IServiceCollection services)
    {
        // 数据库链接字符串
        services.Configure<AppSettings>(Configuration.GetSection("AppSettings"));

        services.AddScoped<IDatabaseContext, MySqlContext>();

        services.AddTransient<IUnitOfWork, UnitOfWork>();

}

@beetlex-io
Copy link
Owner

考虑引入一个 控制器创建事件,用于给应用者在事件中使用IOC组件创建控制器对象

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants