コード例 #1
0
ファイル: GenericMappedType.cs プロジェクト: weimingtom/boo
        public static GenericMappedType Create(IType sourceType, GenericConstructedType containingType)
        {
            var pair = new KeyValuePair <IType, GenericConstructedType>(sourceType, containingType);
            GenericMappedType result;

            if (!_cache.TryGetValue(pair, out result))
            {
                result       = new GenericMappedType(sourceType, containingType);
                _cache[pair] = result;
            }
            return(result);
        }
コード例 #2
0
ファイル: TypeMapper.cs プロジェクト: weimingtom/boo
        public virtual IType MapNestedType(IType sourceType)
        {
            var containingType       = (IType)sourceType.DeclaringEntity;
            var mappedContainingType = MapType(containingType);

            if (containingType == mappedContainingType)
            {
                return(sourceType);
            }

            var mt = sourceType as IGenericMappedType;

            if (mt != null)
            {
                sourceType = mt.SourceType;
            }

            return(GenericMappedType.Create(sourceType, (GenericConstructedType)mappedContainingType));
        }