Ejemplo n.º 1
0
 /// <summary>Registers an instance</summary>
 public static RegistrationInfo RegisterInstance <T>(this ContainerBuilder builder, T instance) where T : class =>
 builder.Add(typeof(T), instance : instance);
Ejemplo n.º 2
0
 /// <summary>Registers a generic type definition</summary>
 public static RegistrationInfo RegisterGeneric(this ContainerBuilder builder, Type genericTypeDefinition) =>
 builder.Add(genericTypeDefinition, genericTypeDefinition);
Ejemplo n.º 3
0
 /// <summary>Registers a type</summary>
 public static RegistrationInfo Register <TService>(
     this ContainerBuilder builder, Func <IResolver, TService> factory) =>
 builder.Add(typeof(TService), factory: resolver => factory(resolver));
Ejemplo n.º 4
0
 /// <summary>Registers a type</summary>
 public static RegistrationInfo RegisterType <TImplementation>(this ContainerBuilder builder) =>
 builder.Add(typeof(TImplementation), typeof(TImplementation));