public static RegisterProxyDescriptor Create(object instance, RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { InstanceOfImplementation = instance, ProxyType = RegisterProxyType.InstanceSelf, LifetimeType = lifetimeType }); }
public static RegisterProxyDescriptor Create <TImplementationSelf>(RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { ImplementationTypeSelf = typeof(TImplementationSelf), ProxyType = RegisterProxyType.TypeSelf, LifetimeType = lifetimeType }); }
public static RegisterProxyDescriptor Create(Func <object> instanceFunc, RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { InstanceFuncForImplementation = instanceFunc, ProxyType = RegisterProxyType.InstanceSelfFunc, LifetimeType = lifetimeType }); }
public static RegisterProxyDescriptor Create <TService>(object instance, RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { ServiceType = typeof(TService), InstanceOfImplementation = instance, ProxyType = RegisterProxyType.TypeToInstance, LifetimeType = lifetimeType }); }
public static RegisterProxyDescriptor Create <TService, TImplementation>(RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { ServiceType = typeof(TService), ImplementationType = typeof(TImplementation), ProxyType = RegisterProxyType.TypeToType, LifetimeType = lifetimeType }); }
public static Lifetime ToAspectCoreLifetime(this RegisterProxyLifetimeType type) { switch (type) { case RegisterProxyLifetimeType.Scoped: return(Lifetime.Scoped); case RegisterProxyLifetimeType.Singleton: return(Lifetime.Singleton); case RegisterProxyLifetimeType.Transient: return(Lifetime.Transient); default: return(Lifetime.Transient); } }
public static RegisterProxyDescriptor Create <TService, TImplementation>(Func <TImplementation> instanceFunc, RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { ServiceType = typeof(TService), ImplementationType = typeof(TImplementation), InstanceFuncForImplementation = () => instanceFunc(), ProxyType = RegisterProxyType.TypeToInstanceFunc, LifetimeType = lifetimeType }); }
public static RegisterProxyDescriptor Create <TImplementation>(Func <TImplementation> instanceFunc, RegisterProxyLifetimeType lifetimeType) { return(new RegisterProxyDescriptor { ImplementationTypeSelf = typeof(TImplementation), InstanceFuncForImplementation = () => instanceFunc(), ProxyType = RegisterProxyType.InstanceSelfFunc, LifetimeType = lifetimeType }); }