示例#1
0
		private static void RegisterType(System.Type systemType, IType nhibernateType,
			IEnumerable<string> aliases, GetNullableTypeWithLength ctorLength)
		{
			var typeAliases = new List<string>(aliases);
			typeAliases.AddRange(GetClrTypeAliases(systemType));

			RegisterType(nhibernateType, typeAliases, ctorLength);
		}
示例#2
0
        private static void RegisterType(System.Type systemType, IType nhibernateType,
                                         IEnumerable <string> aliases, GetNullableTypeWithLength ctorLength)
        {
            var typeAliases = new List <string>(aliases);

            typeAliases.AddRange(GetClrTypeAliases(systemType));

            RegisterType(nhibernateType, typeAliases, ctorLength);
        }
示例#3
0
        private static NullableType GetType(NullableType defaultUnqualifiedType, int length, GetNullableTypeWithLength ctorDelegate)
        {
            string key = GetKeyForLengthBased(defaultUnqualifiedType.Name, length);
            IType  returnType;

            if (!typeByTypeOfName.TryGetValue(key, out returnType))
            {
                returnType = ctorDelegate(length);
                AddToTypeOfNameWithLength(key, returnType);
            }

            return((NullableType)returnType);
        }
示例#4
0
        private static void RegisterType(IType nhibernateType, IEnumerable <string> aliases, GetNullableTypeWithLength ctorLength)
        {
            var typeAliases = new List <string>(aliases)
            {
                nhibernateType.Name
            };

            foreach (var alias in typeAliases)
            {
                typeByTypeOfName[alias] = nhibernateType;
                if (!getTypeDelegatesWithLength.TryAdd(alias, ctorLength))
                {
                    throw new HibernateException("An item with the same key has already been added to getTypeDelegatesWithLength.");
                }
            }
        }
        private static void RegisterType(IType nhibernateType, IEnumerable <string> aliases, GetNullableTypeWithLength ctorLength)
        {
            var typeAliases = new List <string>(aliases)
            {
                nhibernateType.Name
            };

            foreach (var alias in typeAliases)
            {
                typeByTypeOfName[alias] = nhibernateType;
                getTypeDelegatesWithLength.Add(alias, ctorLength);
            }
        }
		private static NullableType GetType(NullableType defaultUnqualifiedType, int length, GetNullableTypeWithLength ctorDelegate)
		{
			string key = GetKeyForLengthBased(defaultUnqualifiedType.Name, length);
			IType returnType;
			if (!typeByTypeOfName.TryGetValue(key, out returnType))
			{
				returnType = ctorDelegate(length);
				AddToTypeOfNameWithLength(key, returnType);
			}

			return (NullableType)returnType;
		}
		private static void RegisterType(IType nhibernateType, IEnumerable<string> aliases, GetNullableTypeWithLength ctorLength)
		{
			var typeAliases = new List<string>(aliases) { nhibernateType.Name };
			foreach (var alias in typeAliases)
			{
				typeByTypeOfName[alias] = nhibernateType;
				getTypeDelegatesWithLength.Add(alias, ctorLength);
			}
		}
示例#8
0
		private static void RegisterType(IType nhibernateType, IEnumerable<string> aliases, GetNullableTypeWithLength ctorLength)
		{
			var typeAliases = new List<string>(aliases) { nhibernateType.Name };
			foreach (var alias in typeAliases)
			{
				typeByTypeOfName[alias] = nhibernateType;
				if (!getTypeDelegatesWithLength.TryAdd(alias, ctorLength))
				{
					throw new HibernateException("An item with the same key has already been added to getTypeDelegatesWithLength.");
				}
			}
		}