softworm

Results 4 comments of softworm

> Is there any update on a solution for this? I've just discovered this limitation while building out some reusable images for a large project. I have multi-stage images which...

也可以考虑选项模式: ```csharp //Option类 public class DbOptions { public IDbContext DB { get; set; } } //注册多库配置 services.Configure("db1", o => { o.DB = new PostgreSQLContext(() => new NpgsqlConnection(config.GetConnectionString("pgsql"))) { ConvertToLowercase =...

@shuxinqin 看下有无弊端,考虑加入wiki?比创建实现接口要简单一些。

> > 因为在实例化类调用构造函数时,`NAutowired`一无所知,它是在类已经被实例化完成后再进行属性赋值的, 因此在构造函数中使用带有`Autowired Attribute`的字段是无法起作用的。也许引入类似`Castle`之类的动态代理能够解决。 或许可以考虑反射获取构造函数及参数,再逐个检查注入对象型参数的属性。但使用构造函数注入依赖时,其形参通常是接口类型或基类类型,这时处理起来也非常棘手。因为单纯通过反射根本无法获取实参,况且也无法得知构造参数与字段的对应关系。 如果引入动态代理,将构造函数代理并逐个检查注入实参,这样理论上确实可行。:smile: