Пример #1
0
        public ImportType(Type type, ImportCardinality cardinality)
        {
            Assumes.NotNull(type);

            this._type = type;
            this._isAssignableCollectionType = IsTypeAssignableCollectionType(type);

            if (cardinality == ImportCardinality.ZeroOrMore)
            {
                this._elementType = CollectionServices.GetEnumerableElementType(type);
            }

            this._lazyType = CreateLazyType(this._elementType ?? this._type);
        }
Пример #2
0
        public ImportType(Type type, ImportCardinality cardinality)
        {
            Assumes.NotNull(type);

            this._type = type;
            this._isAssignableCollectionType = IsTypeAssignableCollectionType(type);

            if (cardinality == ImportCardinality.ZeroOrMore)
            {
                this._elementType = CollectionServices.GetEnumerableElementType(type);
            }

            this._lazyType = CreateLazyType(this._elementType ?? this._type);
        }