Esempio n. 1
0
        public static ReflectionParameterImportDefinition CreateParameterImportDefinition(ParameterInfo parameter, ICompositionElement origin)
        {
            Requires.NotNull(parameter, "parameter");

            ReflectionParameter reflectionParameter = parameter.ToReflectionParameter();

            AttributedImportDefinitionCreationInfo importCreationInfo = AttributedModelDiscovery.GetImportDefinitionCreationInfo(reflectionParameter, parameter);
            return new ReflectionParameterImportDefinition(
                parameter.AsLazy(),
                importCreationInfo.ContractName,
                importCreationInfo.RequiredTypeIdentity,
                importCreationInfo.RequiredMetadata,
                importCreationInfo.Cardinality,
                importCreationInfo.RequiredCreationPolicy,
                origin);
        }
 private static ReflectionParameterImportDefinition CreateReflectionParameterImportDefinition(ParameterInfo parameter)
 {
     return new ReflectionParameterImportDefinition(
         parameter.AsLazy(), AttributedModelServices.GetContractName(parameter.ParameterType), (string)null, null, ImportCardinality.ZeroOrMore, CreationPolicy.NonShared, null);
 }