我需要此IService是可重用的。每当IService被注入到构造函数中,我都需要Service.Dependent来引用注入类的类型。 builder.Register<Service>(c =>
{
var a = new Service();
a.Dependent = c.Resolve<CallingType??>(TypedParameter.
我有一个自定义限定符,它需要参数 - 枚举值。枚举值包含特定于所需实例构造的信息。 如果我到增加新的价值,枚举它会导致相同的样板代码模块中,像这样: 预选赛(JAVA): @Documented
@Qualifier
@Retention(RUNTIME)
public @interface Format {
Type value() default SYSTEM;
enum Type
我在类和接口之下创建了,但原型bean构造函数没有被调用。我正在使用@Lookup来创建原型范围的bean。 public interface IProtoTypeBean {}
@Component
@Scope(value = "prototype")
public class ProtoTypeBean implements IProtoTypeBean {
public