System\Data\Common\CommandTrees\ExpressionBuilder\Internal\ArgumentValidation.cs (57)
38throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_General_PolymorphicTypeRequired(TypeHelpers.GetFullName(type)), "type");
61TypeHelpers.GetFullName(expression.ResultType),
62TypeHelpers.GetFullName(requiredResultType)
79bool valueIsPrimitive = TypeHelpers.TryGetPrimitiveTypeKind(expression.ResultType, out valueTypeKind);
92: TypeHelpers.GetFullName(expression.ResultType)),
114endType = TypeHelpers.CreateReferenceTypeUsage(TypeHelpers.GetEdmType<EntityType>(endType));
119if (TypeHelpers.GetCommonTypeUsage(endType, from.ResultType) == null)
121throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_RelNav_WrongSourceType(TypeHelpers.GetFullName(endType)), "from");
126throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_RelNav_WrongSourceType(TypeHelpers.GetFullName(endType)), "from");
149TypeUsage commonType = TypeHelpers.GetCommonTypeUsage(left.ResultType, right.ResultType);
162if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(left.ResultType)))
164throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_InvalidTypeForSetOperation(TypeHelpers.GetElementTypeUsage(left.ResultType).Identity, typeof(TExpressionType).Name), "left");
167if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(right.ResultType)))
169throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_InvalidTypeForSetOperation(TypeHelpers.GetElementTypeUsage(right.ResultType).Identity, typeof(TExpressionType).Name), "right");
232return TypeHelpers.GetCommonTypeUsage(left.ResultType, right.ResultType);
268if (!TypeHelpers.TryGetCollectionElementType(input.ResultType, out elementType))
304if (!TypeHelpers.TryGetCollectionElementType(input.ResultType, out elementType))
343if (TypeHelpers.TryGetCollectionElementType(paramType, out elementType))
365if (!TypeHelpers.IsValidSortOpKeyType(key.ResultType))
585if (!TypeHelpers.IsValidGroupKeyType(keyInfo.Value.ResultType))
743return TypeHelpers.GetLiteralTypeUsage(primitiveTypeKind);
760if(TypeHelpers.TryGetEdmType<EnumType>(constantType, out edmEnumType))
778if (!TypeHelpers.TryGetEdmType<PrimitiveType>(constantType, out primitiveType))
884if (TypeHelpers.TryGetClosestPromotableType(argument.ResultType, out closestPromotableType))
965if (!TypeHelpers.IsValidIsNullOpType(argument.ResultType))
1011throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_Cast_InvalidCast(TypeHelpers.GetFullName(argument.ResultType), TypeHelpers.GetFullName(toType)));
1052if (!TypeHelpers.TryGetCollectionElementType(argument.ResultType, out elementType) ||
1097if (!TypeHelpers.TryGetRefEntityType(argument.ResultType, out entityType))
1113if (!TypeHelpers.TryGetEdmType<EntityType>(argument.ResultType, out entityType) || null == entityType)
1192TypeUsage keyType = CreateResultType(TypeHelpers.CreateKeyRowType(entitySet.ElementType));
1203if (!TypeHelpers.TryGetEdmType<RefType>(argument.ResultType, out refType) || null == refType)
1211return CreateResultType(TypeHelpers.CreateKeyRowType(refType.ElementType));
1297CollectionType inputType = TypeHelpers.GetEdmType<CollectionType>(argument.ResultType);
1298if (!TypeHelpers.IsValidDistinctOpType(inputType.TypeUsage))
1318return TypeHelpers.GetEdmType<CollectionType>(argument.ResultType).TypeUsage;
1434commonResultType = TypeHelpers.GetCommonTypeUsage(exp.ResultType, commonResultType);
1444commonResultType = TypeHelpers.GetCommonTypeUsage(elseExpression.ResultType, commonResultType);
1582return CreateResultType(TypeHelpers.CreateRowType(columnTypes));
1593if (TypeHelpers.TryGetEdmType<CollectionType>(instanceType, out collectionType) &&
1626throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_NewInstance_CannotInstantiateAbstractType(TypeHelpers.GetFullName(instanceType)), "instanceType");
1629var members = TypeHelpers.GetAllStructuralMembers(structType);
1632throw EntityUtil.Argument(System.Data.Entity.Strings.Cqt_NewInstance_CannotInstantiateMemberlessType(TypeHelpers.GetFullName(instanceType)), "instanceType");
1661EntityTypeBase expectedSourceType = TypeHelpers.GetEdmType<RefType>(relatedRef.SourceEnd.TypeUsage).ElementType;
1715if (TypeHelpers.TryGetEdmType<StructuralType>(instance.ResultType, out structType))
1735throw EntityUtil.ArgumentOutOfRange(System.Data.Entity.Strings.Cqt_Factory_NoSuchProperty(propertyName, TypeHelpers.GetFullName(instance.ResultType)), "propertyName");
1987TypeHelpers.CreateCollectionType(
1989TypeHelpers.CreateRowType(columns)
2000TypeHelpers.CreateCollectionType(
2010TypeUsage retUsage = TypeUsage.Create(TypeHelpers.CreateCollectionType(type));
2030retType = TypeHelpers.CreateReferenceTypeUsage(TypeHelpers.GetEdmType<EntityType>(retType));
2038retType = TypeHelpers.CreateCollectionTypeUsage(retType);
2046return TypeUsage.Create(TypeHelpers.CreateReferenceType(referencedEntityType));
System\Data\Common\EntitySql\SemanticAnalyzer.cs (46)
627TypeUsage literalTypeUsage = TypeHelpers.GetLiteralTypeUsage(primitiveType.PrimitiveTypeKind, literal.IsUnicodeString);
1288ConvertUntypedNullsInArguments(args, functionType.Parameters, (parameter) => TypeHelpers.GetElementTypeUsage(parameter.TypeUsage));
1341foreach (EdmMember member in TypeHelpers.GetAllStructuralMembers(stype))
1424newInstance = DbExpressionBuilder.New(TypeHelpers.GetReadOnlyType(type), args);
1882RowType entityKeyRowType = TypeHelpers.CreateKeyRowType(entitySet.ElementType);
2003if (null == TypeHelpers.GetCommonTypeUsage(operands.Left.ResultType, operands.Right.ResultType))
2038if (TypeHelpers.GetCommonTypeUsage(operands.Left.ResultType, operands.Right.ResultType) == null)
2192TypeUsage leftElemType = TypeHelpers.GetElementTypeUsage(leftExpr.ResultType);
2193TypeUsage rightElemType = TypeHelpers.GetElementTypeUsage(rightExpr.ResultType);
2204if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(leftExpr.ResultType)))
2210TypeHelpers.GetElementTypeUsage(leftExpr.ResultType).EdmType.FullName));
2216if (!TypeHelpers.IsSetComparableOpType(TypeHelpers.GetElementTypeUsage(rightExpr.ResultType)))
2222TypeHelpers.GetElementTypeUsage(rightExpr.ResultType).EdmType.FullName));
2255if (astBuiltInExpr.Kind == AST.BuiltInKind.Distinct && !TypeHelpers.IsValidDistinctOpType(TypeHelpers.GetElementTypeUsage(leftExpr.ResultType)))
2285TypeUsage elementType = TypeHelpers.GetElementTypeUsage(rightExpr.ResultType);
2298TypeUsage commonElemType = TypeHelpers.GetCommonTypeUsage(leftExpr.ResultType, TypeHelpers.GetElementTypeUsage(rightExpr.ResultType));
2299if (null == commonElemType || !TypeHelpers.IsValidInOpType(commonElemType))
2489converted = TypeHelpers.CreateCollectionTypeUsage(elementType, true /* readOnly */);
2507converted = TypeHelpers.CreateReferenceTypeUsage((EntityType)targetTypeUsage.EdmType);
2513converted = TypeHelpers.CreateRowTypeUsage(
2566return new ValueExpression(DbExpressionBuilder.New(TypeHelpers.CreateRowTypeUsage(rowColumns, true /* readOnly */), fieldExprs));
2593TypeUsage commonType = TypeHelpers.GetCommonTypeUsage(multisetTypes);
2603commonType = TypeHelpers.GetReadOnlyType(commonType);
2617return new ValueExpression(DbExpressionBuilder.New(TypeHelpers.CreateCollectionTypeUsage(commonType, true /* readOnly */), mSetExprs));
2672TypeUsage resultType = TypeHelpers.GetCommonTypeUsage(resultTypes);
2960TypeUsage projectionType = TypeHelpers.GetElementTypeUsage(projectExpressionResultType);
2961if (!TypeHelpers.IsValidDistinctOpType(projectionType))
2970if (!TypeHelpers.IsValidDistinctOpType(rowType.Members[i].TypeUsage))
3456if (!TypeHelpers.IsValidGroupKeyType(keyExpr.ResultType))
3978IBaseList<EdmMember> inputVariableTypeProperties = TypeHelpers.GetAllStructuralMembers(projectExpression.Input.Variable.ResultType);
4183if (!TypeHelpers.IsValidSortOpKeyType(keyExpr.ResultType))
4482if (!TypeHelpers.TryGetClosestPromotableType(argument.ResultType, out closestPromotableType))
4731if (!TypeSemantics.IsCollectionType(TypeHelpers.GetElementTypeUsage(elemExpr.ResultType)))
4847if (isNullExpr != null && !TypeHelpers.IsValidIsNullOpType(isNullExpr.ResultType))
4867if (isNullExpr != null && !TypeHelpers.IsValidIsNullOpType(isNullExpr.ResultType))
4937typeToFilterTo = TypeHelpers.GetReadOnlyType(typeToFilterTo);
5019return exprToTreat.TreatAs(TypeHelpers.GetReadOnlyType(typeToTreatTo));
5058return exprToCast.CastTo(TypeHelpers.GetReadOnlyType(typeToCastTo));
5080TypeUsage elementType = TypeHelpers.GetElementTypeUsage(exprToFilter.ResultType);
5116ofTypeExpression = exprToFilter.OfTypeOnly(TypeHelpers.GetReadOnlyType(typeToFilterTo));
5120ofTypeExpression = exprToFilter.OfType(TypeHelpers.GetReadOnlyType(typeToFilterTo));
5216TypeUsage rangeCommonType = TypeHelpers.GetCommonTypeUsage(limitsExpr.Left.ResultType, limitsExpr.Right.ResultType);
System\Data\Metadata\TypeHelpers.cs (9)
39AssertEdmType(TypeHelpers.GetElementTypeUsage(typeUsage));
43foreach (EdmMember m in TypeHelpers.GetDeclaredStructuralMembers(typeUsage))
284return TypeHelpers.TryGetBooleanFacetValue(type, DbProviderManifest.FixedLengthFacetName, out isFixedLength);
295return TypeHelpers.TryGetBooleanFacetValue(type, DbProviderManifest.UnicodeFacetName, out isUnicode);
314return TypeHelpers.TryGetIntFacetValue(type, DbProviderManifest.MaxLengthFacetName, out maxLength);
325return TypeHelpers.TryGetByteFacetValue(type, DbProviderManifest.PrecisionFacetName, out precision);
336return TypeHelpers.TryGetByteFacetValue(type, DbProviderManifest.ScaleFacetName, out scale);
428return TypeHelpers.CreateRowType(resultCols);
603if (TypeHelpers.TryGetEdmType<CollectionType>(type, out collectionType))
System\Data\Objects\ELinq\MethodCallTranslator.cs (5)
746result = ValidateReturnType(result, TypeHelpers.GetElementTypeUsage(actualReturnType), parent, call, elementType, true);
1618var resultType = TypeUsage.Create(TypeHelpers.CreateRowType(
1626return new DbJoinExpression(DbExpressionKind.InnerJoin, TypeUsage.Create(TypeHelpers.CreateCollectionType(resultType)), outerBinding, innerBinding, joinCondition);
2540var resultType = TypeUsage.Create(TypeHelpers.CreateRowType(
2548return new DbApplyExpression(DbExpressionKind.OuterApply, TypeUsage.Create(TypeHelpers.CreateCollectionType(resultType)), newInput, newApply);
System\Data\SqlClient\SqlGen\SqlGenerator.cs (23)
829if (!TypeHelpers.IsCanonicalFunction(function) && !SqlFunctionCallHandler.IsStoreFunction(function))
870(TypeHelpers.TryGetIsUnicode(argument.ResultType, out isUnicode)) &&
893(!TypeHelpers.TryGetBooleanFacetValue(type, DbProviderManifest.UnicodeFacetName, out isUnicode));
912if (TypeHelpers.TryGetPrimitiveTypeKind(resultType, out typeKind))
1017if (!TypeHelpers.TryGetIsUnicode(e.ResultType, out isUnicode))
1184TypeUsage inputType = TypeHelpers.GetElementTypeUsage(e.Argument.ResultType);
1438RowType groupByType = TypeHelpers.GetEdmType<RowType>(TypeHelpers.GetEdmType<CollectionType>(e.ResultType).TypeUsage);
1700TypeUsage inputType = TypeHelpers.GetElementTypeUsage(e.Argument.ResultType);
2662if (TypeHelpers.IsCanonicalFunction(functionAggregate.Function)
2923TypeUsage inputType = TypeHelpers.GetElementTypeUsage(elementExpr.Argument.ResultType);
2934CollectionType collectionType = TypeHelpers.GetEdmType<CollectionType>(e.ResultType);
3352Symbol fromSymbol = new Symbol("X", TypeHelpers.GetElementTypeUsage(left.ResultType), leftSelectStatement.OutputColumns, true);
3486foreach (EdmProperty property in TypeHelpers.GetProperties(symbol.Type))
3837if (!TypeHelpers.IsFacetValueConstant(storeTypeUsage, DbProviderManifest.MaxLengthFacetName))
3839hasFacet = TypeHelpers.TryGetMaxLength(storeTypeUsage, out maxLength);
3846if (!TypeHelpers.IsFacetValueConstant(storeTypeUsage, DbProviderManifest.MaxLengthFacetName))
3848hasFacet = TypeHelpers.TryGetMaxLength(storeTypeUsage, out maxLength);
3867if (!TypeHelpers.IsFacetValueConstant(storeTypeUsage, DbProviderManifest.PrecisionFacetName))
3869hasFacet = TypeHelpers.TryGetPrecision(storeTypeUsage, out decimalPrecision);
3872hasFacet = TypeHelpers.TryGetScale(storeTypeUsage, out decimalScale);
4108type = TypeHelpers.GetElementTypeUsage(e.ResultType);
4113type = TypeHelpers.GetEdmType<CollectionType>(e.ResultType).TypeUsage;
System\Data\SqlClient\SqlProviderManifest.cs (10)
374isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
381isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
388isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
395isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
419isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
425isUnbounded = !TypeHelpers.TryGetMaxLength(storeType, out maxLength);
449if (TypeHelpers.TryGetPrecision(storeType, out precision) && TypeHelpers.TryGetScale(storeType, out scale))
575if (!TypeHelpers.TryGetPrecision(edmType, out precision))
581if (!TypeHelpers.TryGetScale(edmType, out scale))