Exemple #1
0
 /// <summary>
 /// registers the provided concrete instance and scans it for generic MetadataAttribute data
 /// </summary>
 /// <typeparam name="TInstance">concrete instance type</typeparam>
 /// <returns></returns>
 public IRegistrationBuilder <TInstance, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterAttributedType <TInstance>() where TInstance : TInterface
 {
     return
         (ContainerBuilder.RegisterType <TInstance>().As <TInterface>().WithMetadata(
              MetadataHelper.GetMetadata(typeof(TInstance))));
 }
Exemple #2
0
 /// <summary>
 /// registers the provided concrrete instance type and scans it for generate metadata data
 /// </summary>
 /// <param name="instanceType">Type of the instance.</param>
 /// <returns></returns>
 public IRegistrationBuilder <object, ConcreteReflectionActivatorData, SingleRegistrationStyle> RegisterAttributedType(Type instanceType)
 {
     return
         (ContainerBuilder.RegisterType(instanceType).As <TInterface>().WithMetadata(
              MetadataHelper.GetMetadata(instanceType)));
 }
Exemple #3
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)));
 }