private static void Register(this IProfileRegistry registry, ServiceDescriptor descriptor) { if (descriptor.ImplementationType != null) { registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.ImplementationType); return; } if (descriptor.ImplementationFactory != null) { registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.CreateFactory()); return; } registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.ImplementationInstance); }
private static void Register(this IProfileRegistry registry, ServiceDescriptor descriptor) { if (descriptor.ImplementationType != null) { registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.ImplementationType); return; } if (descriptor.ImplementationFactory != null) { registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.CreateFactory()); return; } registry.For(descriptor.ServiceType) .LifecycleIs(descriptor.Lifetime) .Use(descriptor.ImplementationInstance); }