Beispiel #1
0
 /// <summary>
 /// registers provided metadata on the declared type
 /// </summary>
 /// <param name="instanceType">Type of the instance.</param>
 /// <param name="metadata">The metadata.</param>
 /// <returns>registration builder</returns>
 public IRegistrationBuilder <object, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterType(Type instanceType, TMetadata metadata)
 {
     return
         (ContainerBuilder.RegisterType(instanceType).As <TInterface>().WithMetadata(
              MetadataHelper.GetProperties(metadata)));
 }
Beispiel #2
0
 /// <summary>
 /// registers provided metadata on the declared type
 /// </summary>
 /// <typeparam name="TInstance">concrete instance type</typeparam>
 /// <param name="metadata">metadata instance</param>
 /// <returns>container builder</returns>
 public IRegistrationBuilder <TInstance, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterType <TInstance>(TMetadata metadata) where TInstance : TInterface
 {
     return
         (ContainerBuilder.RegisterType <TInstance>().As <TInterface>().WithMetadata(
              MetadataHelper.GetProperties(metadata)));
 }