System\Data\Common\CommandTrees\ExpressionBuilder\Internal\ArgumentValidation.cs (23)
24private static TypeUsage _booleanType = EdmProviderManifest.Instance.GetCanonicalModelTypeUsage(PrimitiveTypeKind.Boolean);
69private static void RequireCompatibleType(DbExpression expression, PrimitiveTypeKind requiredResultType, string argumentName)
74private static void RequireCompatibleType(DbExpression expression, PrimitiveTypeKind requiredResultType, string argumentName, int index)
78PrimitiveTypeKind valueTypeKind;
91Enum.GetName(typeof(PrimitiveTypeKind), valueTypeKind)
93Enum.GetName(typeof(PrimitiveTypeKind), requiredResultType)
381if (!TypeSemantics.IsPrimitiveType(key.ResultType, PrimitiveTypeKind.String))
436RequireCompatibleType(predicate, PrimitiveTypeKind.Boolean, "predicate");
542RequireCompatibleType(joinCondition, PrimitiveTypeKind.Boolean, "joinCondition");
557RequireCompatibleType(predicate, PrimitiveTypeKind.Boolean, "predicate");
737PrimitiveTypeKind primitiveTypeKind;
783PrimitiveTypeKind valueKind;
789if (!(Helper.IsGeographicType(primitiveType) && valueKind == PrimitiveTypeKind.Geography)
790&& !(Helper.IsGeometricType(primitiveType) && valueKind == PrimitiveTypeKind.Geometry))
833if (null == resultType || !TypeSemantics.IsPrimitiveType(resultType, PrimitiveTypeKind.Boolean))
844if (null == resultType || !TypeSemantics.IsPrimitiveType(resultType, PrimitiveTypeKind.Boolean))
859if (!TypeSemantics.IsPrimitiveType(argument.ResultType, PrimitiveTypeKind.Boolean))
982RequireCompatibleType(argument, PrimitiveTypeKind.String, "argument");
983RequireCompatibleType(pattern, PrimitiveTypeKind.String, "pattern");
993RequireCompatibleType(escape, PrimitiveTypeKind.String, "escape");
1420RequireCompatibleType(exp, PrimitiveTypeKind.Boolean, "whenExpressions", idx);
2061private static bool TryGetPrimitiveTypeKind(Type clrType, out PrimitiveTypeKind primitiveTypeKind)
2096PrimitiveTypeKind clrEnumUnderlyingTypeKind;
System\Data\Common\CommandTrees\OperatorExpressions.cs (6)
32Debug.Assert(TypeSemantics.IsPrimitiveType(booleanResultType, PrimitiveTypeKind.Boolean), "DbAndExpression requires a Boolean result type");
62Debug.Assert(TypeSemantics.IsPrimitiveType(booleanResultType, PrimitiveTypeKind.Boolean), "DbOrExpression requires a Boolean result type");
92Debug.Assert(TypeSemantics.IsPrimitiveType(booleanResultType, PrimitiveTypeKind.Boolean), "DbNotExpression requires a Boolean result type");
496Debug.Assert(TypeSemantics.IsPrimitiveType(input.ResultType, PrimitiveTypeKind.String), "DbLikeExpression argument must have a string result type");
497Debug.Assert(TypeSemantics.IsPrimitiveType(pattern.ResultType, PrimitiveTypeKind.String), "DbLikeExpression pattern must have a string result type");
498Debug.Assert(TypeSemantics.IsPrimitiveType(escape.ResultType, PrimitiveTypeKind.String), "DbLikeExpression escape must have a string result type");
System\Data\Common\Internal\DbTypeMap.cs (24)
25internal static readonly TypeUsage AnsiString = CreateType(PrimitiveTypeKind.String, new FacetValues { Unicode = false, FixedLength = false, MaxLength = (int?)null });
26internal static readonly TypeUsage AnsiStringFixedLength = CreateType(PrimitiveTypeKind.String, new FacetValues { Unicode = false, FixedLength = true, MaxLength = (int?)null });
27internal static readonly TypeUsage String = CreateType(PrimitiveTypeKind.String, new FacetValues { Unicode = true, FixedLength = false, MaxLength = (int?)null });
28internal static readonly TypeUsage StringFixedLength = CreateType(PrimitiveTypeKind.String, new FacetValues { Unicode = true, FixedLength = true, MaxLength = (int?)null });
31internal static readonly TypeUsage Xml = CreateType(PrimitiveTypeKind.String, new FacetValues { Unicode = true, FixedLength = false, MaxLength = (int?)null });
32internal static readonly TypeUsage Binary = CreateType(PrimitiveTypeKind.Binary , new FacetValues { MaxLength = (int?)null });
33internal static readonly TypeUsage Boolean = CreateType(PrimitiveTypeKind.Boolean);
34internal static readonly TypeUsage Byte = CreateType(PrimitiveTypeKind.Byte);
35internal static readonly TypeUsage DateTime = CreateType(PrimitiveTypeKind.DateTime);
36internal static readonly TypeUsage Date = CreateType(PrimitiveTypeKind.DateTime);
37internal static readonly TypeUsage DateTime2 = CreateType(PrimitiveTypeKind.DateTime, new FacetValues { Precision = (byte?)null });
38internal static readonly TypeUsage Time = CreateType(PrimitiveTypeKind.Time, new FacetValues { Precision = (byte?)null });
39internal static readonly TypeUsage DateTimeOffset = CreateType(PrimitiveTypeKind.DateTimeOffset, new FacetValues { Precision = (byte?)null });
42internal static readonly TypeUsage Decimal = CreateType(PrimitiveTypeKind.Decimal, new FacetValues { Precision = (byte?)null, Scale = (byte?)null });
44internal static readonly TypeUsage Currency = CreateType(PrimitiveTypeKind.Decimal, new FacetValues { Precision = (byte?)null, Scale = (byte?)null });
45internal static readonly TypeUsage Double = CreateType(PrimitiveTypeKind.Double);
46internal static readonly TypeUsage Guid = CreateType(PrimitiveTypeKind.Guid);
47internal static readonly TypeUsage Int16 = CreateType(PrimitiveTypeKind.Int16);
48internal static readonly TypeUsage Int32 = CreateType(PrimitiveTypeKind.Int32);
49internal static readonly TypeUsage Int64 = CreateType(PrimitiveTypeKind.Int64);
50internal static readonly TypeUsage Single = CreateType(PrimitiveTypeKind.Single);
51internal static readonly TypeUsage SByte = CreateType(PrimitiveTypeKind.SByte);
157private static TypeUsage CreateType(PrimitiveTypeKind type)
162private static TypeUsage CreateType(PrimitiveTypeKind type, FacetValues facets)
System\Data\Metadata\Edm\Provider\ClrProviderManifest.cs (57)
61PrimitiveTypeKind resolvedTypeKind;
73/// Returns the <see cref="PrimitiveTypeKind"/> corresponding to the given CLR type
78internal bool TryGetPrimitiveTypeKind(Type clrType, out PrimitiveTypeKind resolvedPrimitiveTypeKind)
80PrimitiveTypeKind? primitiveTypeKind = null;
88primitiveTypeKind = PrimitiveTypeKind.Boolean;
91primitiveTypeKind = PrimitiveTypeKind.Byte;
94primitiveTypeKind = PrimitiveTypeKind.DateTime;
98primitiveTypeKind = PrimitiveTypeKind.Decimal;
101primitiveTypeKind = PrimitiveTypeKind.Double;
107primitiveTypeKind = PrimitiveTypeKind.Int16;
110primitiveTypeKind = PrimitiveTypeKind.Int32;
113primitiveTypeKind = PrimitiveTypeKind.Int64;
116primitiveTypeKind = PrimitiveTypeKind.SByte;
119primitiveTypeKind = PrimitiveTypeKind.Single;
122primitiveTypeKind = PrimitiveTypeKind.String;
129primitiveTypeKind = PrimitiveTypeKind.Binary;
133primitiveTypeKind = PrimitiveTypeKind.DateTimeOffset;
138primitiveTypeKind = PrimitiveTypeKind.Geography;
142primitiveTypeKind = PrimitiveTypeKind.Geometry;
146primitiveTypeKind = PrimitiveTypeKind.Guid;
150primitiveTypeKind = PrimitiveTypeKind.Time;
164resolvedPrimitiveTypeKind = default(PrimitiveTypeKind);
206primitiveTypes[(int)PrimitiveTypeKind.Binary] = CreatePrimitiveType(typeof(Byte[]), PrimitiveTypeKind.Binary);
207primitiveTypes[(int)PrimitiveTypeKind.Boolean] = CreatePrimitiveType(typeof(Boolean), PrimitiveTypeKind.Boolean);
208primitiveTypes[(int)PrimitiveTypeKind.Byte] = CreatePrimitiveType(typeof(Byte), PrimitiveTypeKind.Byte);
209primitiveTypes[(int)PrimitiveTypeKind.DateTime] = CreatePrimitiveType(typeof(DateTime), PrimitiveTypeKind.DateTime);
210primitiveTypes[(int)PrimitiveTypeKind.Time] = CreatePrimitiveType(typeof(TimeSpan), PrimitiveTypeKind.Time);
211primitiveTypes[(int)PrimitiveTypeKind.DateTimeOffset] = CreatePrimitiveType(typeof(DateTimeOffset), PrimitiveTypeKind.DateTimeOffset);
212primitiveTypes[(int)PrimitiveTypeKind.Decimal] = CreatePrimitiveType(typeof(Decimal), PrimitiveTypeKind.Decimal);
213primitiveTypes[(int)PrimitiveTypeKind.Double] = CreatePrimitiveType(typeof(Double), PrimitiveTypeKind.Double);
214primitiveTypes[(int)PrimitiveTypeKind.Geography] = CreatePrimitiveType(typeof(DbGeography), PrimitiveTypeKind.Geography);
215primitiveTypes[(int)PrimitiveTypeKind.Geometry] = CreatePrimitiveType(typeof(DbGeometry), PrimitiveTypeKind.Geometry);
216primitiveTypes[(int)PrimitiveTypeKind.Guid] = CreatePrimitiveType(typeof(Guid), PrimitiveTypeKind.Guid);
217primitiveTypes[(int)PrimitiveTypeKind.Int16] = CreatePrimitiveType(typeof(Int16), PrimitiveTypeKind.Int16);
218primitiveTypes[(int)PrimitiveTypeKind.Int32] = CreatePrimitiveType(typeof(Int32), PrimitiveTypeKind.Int32);
219primitiveTypes[(int)PrimitiveTypeKind.Int64] = CreatePrimitiveType(typeof(Int64), PrimitiveTypeKind.Int64);
220primitiveTypes[(int)PrimitiveTypeKind.SByte] = CreatePrimitiveType(typeof(SByte), PrimitiveTypeKind.SByte);
221primitiveTypes[(int)PrimitiveTypeKind.Single] = CreatePrimitiveType(typeof(Single), PrimitiveTypeKind.Single);
222primitiveTypes[(int)PrimitiveTypeKind.String] = CreatePrimitiveType(typeof(String), PrimitiveTypeKind.String);
235private PrimitiveType CreatePrimitiveType(Type clrType, PrimitiveTypeKind primitiveTypeKind)
System\Data\Metadata\Edm\Provider\EdmProviderManifest.cs (386)
108public PrimitiveType GetPrimitiveType(PrimitiveTypeKind primitiveTypeKind)
125primitiveTypes[(int)PrimitiveTypeKind.Binary] = new PrimitiveType();
126primitiveTypes[(int)PrimitiveTypeKind.Boolean] = new PrimitiveType();
127primitiveTypes[(int)PrimitiveTypeKind.Byte] = new PrimitiveType();
128primitiveTypes[(int)PrimitiveTypeKind.DateTime] = new PrimitiveType();
129primitiveTypes[(int)PrimitiveTypeKind.Decimal] = new PrimitiveType();
130primitiveTypes[(int)PrimitiveTypeKind.Double] = new PrimitiveType();
131primitiveTypes[(int)PrimitiveTypeKind.Single] = new PrimitiveType();
132primitiveTypes[(int)PrimitiveTypeKind.Guid] = new PrimitiveType();
133primitiveTypes[(int)PrimitiveTypeKind.Int16] = new PrimitiveType();
134primitiveTypes[(int)PrimitiveTypeKind.Int32] = new PrimitiveType();
135primitiveTypes[(int)PrimitiveTypeKind.Int64] = new PrimitiveType();
136primitiveTypes[(int)PrimitiveTypeKind.SByte] = new PrimitiveType();
137primitiveTypes[(int)PrimitiveTypeKind.String] = new PrimitiveType();
138primitiveTypes[(int)PrimitiveTypeKind.Time] = new PrimitiveType();
139primitiveTypes[(int)PrimitiveTypeKind.DateTimeOffset] = new PrimitiveType();
140primitiveTypes[(int)PrimitiveTypeKind.Geometry] = new PrimitiveType();
141primitiveTypes[(int)PrimitiveTypeKind.GeometryPoint] = new PrimitiveType();
142primitiveTypes[(int)PrimitiveTypeKind.GeometryLineString] = new PrimitiveType();
143primitiveTypes[(int)PrimitiveTypeKind.GeometryPolygon] = new PrimitiveType();
144primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPoint] = new PrimitiveType();
145primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiLineString] = new PrimitiveType();
146primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPolygon] = new PrimitiveType();
147primitiveTypes[(int)PrimitiveTypeKind.GeometryCollection] = new PrimitiveType();
148primitiveTypes[(int)PrimitiveTypeKind.Geography] = new PrimitiveType();
149primitiveTypes[(int)PrimitiveTypeKind.GeographyPoint] = new PrimitiveType();
150primitiveTypes[(int)PrimitiveTypeKind.GeographyLineString] = new PrimitiveType();
151primitiveTypes[(int)PrimitiveTypeKind.GeographyPolygon] = new PrimitiveType();
152primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPoint] = new PrimitiveType();
153primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiLineString] = new PrimitiveType();
154primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPolygon] = new PrimitiveType();
155primitiveTypes[(int)PrimitiveTypeKind.GeographyCollection] = new PrimitiveType();
157InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Binary], PrimitiveTypeKind.Binary, EdmConstants.Binary, typeof(Byte[]));
158InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Boolean], PrimitiveTypeKind.Boolean, EdmConstants.Boolean, typeof(Boolean));
159InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Byte], PrimitiveTypeKind.Byte, EdmConstants.Byte, typeof(Byte));
160InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.DateTime], PrimitiveTypeKind.DateTime, EdmConstants.DateTime, typeof(DateTime));
161InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Decimal], PrimitiveTypeKind.Decimal, EdmConstants.Decimal, typeof(Decimal));
162InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Double], PrimitiveTypeKind.Double, EdmConstants.Double, typeof(Double));
163InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Single], PrimitiveTypeKind.Single, EdmConstants.Single, typeof(Single));
164InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Guid], PrimitiveTypeKind.Guid, EdmConstants.Guid, typeof(Guid));
165InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Int16], PrimitiveTypeKind.Int16, EdmConstants.Int16, typeof(Int16));
166InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Int32], PrimitiveTypeKind.Int32, EdmConstants.Int32, typeof(Int32));
167InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Int64], PrimitiveTypeKind.Int64, EdmConstants.Int64, typeof(Int64));
168InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.SByte], PrimitiveTypeKind.SByte, EdmConstants.SByte, typeof(SByte));
169InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.String], PrimitiveTypeKind.String, EdmConstants.String, typeof(String));
170InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Time], PrimitiveTypeKind.Time, EdmConstants.Time, typeof(TimeSpan));
171InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.DateTimeOffset], PrimitiveTypeKind.DateTimeOffset, EdmConstants.DateTimeOffset, typeof(DateTimeOffset));
172InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Geography], PrimitiveTypeKind.Geography, EdmConstants.Geography, typeof(DbGeography));
173InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyPoint], PrimitiveTypeKind.GeographyPoint, EdmConstants.GeographyPoint, typeof(DbGeography));
174InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyLineString], PrimitiveTypeKind.GeographyLineString, EdmConstants.GeographyLineString, typeof(DbGeography));
175InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyPolygon], PrimitiveTypeKind.GeographyPolygon, EdmConstants.GeographyPolygon, typeof(DbGeography));
176InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPoint], PrimitiveTypeKind.GeographyMultiPoint, EdmConstants.GeographyMultiPoint, typeof(DbGeography));
177InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiLineString], PrimitiveTypeKind.GeographyMultiLineString, EdmConstants.GeographyMultiLineString, typeof(DbGeography));
178InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPolygon], PrimitiveTypeKind.GeographyMultiPolygon, EdmConstants.GeographyMultiPolygon, typeof(DbGeography));
179InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeographyCollection], PrimitiveTypeKind.GeographyCollection, EdmConstants.GeographyCollection, typeof(DbGeography));
180InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.Geometry], PrimitiveTypeKind.Geometry, EdmConstants.Geometry, typeof(DbGeometry));
181InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryPoint], PrimitiveTypeKind.GeometryPoint, EdmConstants.GeometryPoint, typeof(DbGeometry));
182InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryLineString], PrimitiveTypeKind.GeometryLineString, EdmConstants.GeometryLineString, typeof(DbGeometry));
183InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryPolygon], PrimitiveTypeKind.GeometryPolygon, EdmConstants.GeometryPolygon, typeof(DbGeometry));
184InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPoint], PrimitiveTypeKind.GeometryMultiPoint, EdmConstants.GeometryMultiPoint, typeof(DbGeometry));
185InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiLineString], PrimitiveTypeKind.GeometryMultiLineString, EdmConstants.GeometryMultiLineString, typeof(DbGeometry));
186InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPolygon], PrimitiveTypeKind.GeometryMultiPolygon, EdmConstants.GeometryMultiPolygon, typeof(DbGeometry));
187InitializePrimitiveType(primitiveTypes[(int)PrimitiveTypeKind.GeometryCollection], PrimitiveTypeKind.GeometryCollection, EdmConstants.GeometryCollection, typeof(DbGeometry));
210PrimitiveTypeKind primitiveTypeKind,
244FacetDescription[] list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.String);
245PrimitiveType applicableType = _primitiveTypes[(int)PrimitiveTypeKind.String];
249list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.Binary);
250applicableType = _primitiveTypes[(int)PrimitiveTypeKind.Binary];
254list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.DateTime);
255applicableType = _primitiveTypes[(int)PrimitiveTypeKind.DateTime];
259list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.Time);
260applicableType = _primitiveTypes[(int)PrimitiveTypeKind.Time];
264list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.DateTimeOffset);
265applicableType = _primitiveTypes[(int)PrimitiveTypeKind.DateTimeOffset];
270list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.Decimal);
271applicableType = _primitiveTypes[(int)PrimitiveTypeKind.Decimal];
275list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.Geography);
276applicableType = _primitiveTypes[(int)PrimitiveTypeKind.Geography];
279list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyPoint);
280applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyPoint];
283list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyLineString);
284applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyLineString];
287list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyPolygon);
288applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyPolygon];
291list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyMultiPoint);
292applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPoint];
295list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyMultiLineString);
296applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiLineString];
299list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyMultiPolygon);
300applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyMultiPolygon];
303list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeographyCollection);
304applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeographyCollection];
307list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.Geometry);
308applicableType = _primitiveTypes[(int)PrimitiveTypeKind.Geometry];
311list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryPoint);
312applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryPoint];
315list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryLineString);
316applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryLineString];
319list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryPolygon);
320applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryPolygon];
323list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryMultiPoint);
324applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPoint];
327list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryMultiLineString);
328applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiLineString];
331list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryMultiPolygon);
332applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryMultiPolygon];
335list = EdmProviderManifest.GetInitialFacetDescriptions(PrimitiveTypeKind.GeometryCollection);
336applicableType = _primitiveTypes[(int)PrimitiveTypeKind.GeometryCollection];
345internal static FacetDescription[] GetInitialFacetDescriptions(PrimitiveTypeKind primitiveTypeKind)
351case PrimitiveTypeKind.String:
356MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Int32),
361MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Boolean),
366MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Boolean),
374case PrimitiveTypeKind.Binary:
379MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Int32),
384MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Boolean),
391case PrimitiveTypeKind.DateTime:
396MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Byte),
401case PrimitiveTypeKind.Time:
406MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Byte),
411case PrimitiveTypeKind.DateTimeOffset:
415MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Byte),
420case PrimitiveTypeKind.Decimal:
425MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Byte),
430MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Byte),
436case PrimitiveTypeKind.Geometry:
437case PrimitiveTypeKind.GeometryPoint:
438case PrimitiveTypeKind.GeometryLineString:
439case PrimitiveTypeKind.GeometryPolygon:
440case PrimitiveTypeKind.GeometryMultiPoint:
441case PrimitiveTypeKind.GeometryMultiLineString:
442case PrimitiveTypeKind.GeometryMultiPolygon:
443case PrimitiveTypeKind.GeometryCollection:
448MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Int32),
453MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Boolean),
459case PrimitiveTypeKind.Geography:
460case PrimitiveTypeKind.GeographyPoint:
461case PrimitiveTypeKind.GeographyLineString:
462case PrimitiveTypeKind.GeographyPolygon:
463case PrimitiveTypeKind.GeographyMultiPoint:
464case PrimitiveTypeKind.GeographyMultiLineString:
465case PrimitiveTypeKind.GeographyMultiPolygon:
466case PrimitiveTypeKind.GeographyCollection:
471MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Int32),
476MetadataItem.EdmProviderManifest.GetPrimitiveType(PrimitiveTypeKind.Boolean),
501PrimitiveTypeKind[] parameterTypes;
506parameterTypes = new[] { PrimitiveTypeKind.Byte,
507PrimitiveTypeKind.DateTime,
508PrimitiveTypeKind.Decimal,
509PrimitiveTypeKind.Double,
510PrimitiveTypeKind.Int16,
511PrimitiveTypeKind.Int32,
512PrimitiveTypeKind.Int64,
513PrimitiveTypeKind.SByte,
514PrimitiveTypeKind.Single,
515PrimitiveTypeKind.String,
516PrimitiveTypeKind.Binary,
517PrimitiveTypeKind.Time,
518PrimitiveTypeKind.DateTimeOffset };
524parameterTypes = new[] { PrimitiveTypeKind.Decimal,
525PrimitiveTypeKind.Double,
526PrimitiveTypeKind.Int32,
527PrimitiveTypeKind.Int64 };
533parameterTypes = new[] { PrimitiveTypeKind.Decimal,
534PrimitiveTypeKind.Double,
535PrimitiveTypeKind.Int32,
536PrimitiveTypeKind.Int64};
538functions.ForTypes(parameterTypes, type => functions.AddAggregate(PrimitiveTypeKind.Double, "StDev", type));
539functions.ForTypes(parameterTypes, type => functions.AddAggregate(PrimitiveTypeKind.Double, "StDevP", type));
540functions.ForTypes(parameterTypes, type => functions.AddAggregate(PrimitiveTypeKind.Double, "Var", type));
541functions.ForTypes(parameterTypes, type => functions.AddAggregate(PrimitiveTypeKind.Double, "VarP", type));
544functions.ForAllBasePrimitiveTypes(type => functions.AddAggregate(PrimitiveTypeKind.Int32, "Count", type));
545functions.ForAllBasePrimitiveTypes(type => functions.AddAggregate(PrimitiveTypeKind.Int64, "BigCount", type));
551functions.AddFunction(PrimitiveTypeKind.String, "Trim", PrimitiveTypeKind.String, "stringArgument");
552functions.AddFunction(PrimitiveTypeKind.String, "RTrim", PrimitiveTypeKind.String, "stringArgument");
553functions.AddFunction(PrimitiveTypeKind.String, "LTrim", PrimitiveTypeKind.String, "stringArgument");
554functions.AddFunction(PrimitiveTypeKind.String, "Concat", PrimitiveTypeKind.String, "string1", PrimitiveTypeKind.String, "string2");
555functions.AddFunction(PrimitiveTypeKind.Int32, "Length", PrimitiveTypeKind.String, "stringArgument");
558parameterTypes = new[] { PrimitiveTypeKind.Byte,
559PrimitiveTypeKind.Int16,
560PrimitiveTypeKind.Int32,
561PrimitiveTypeKind.Int64,
562PrimitiveTypeKind.SByte };
564functions.ForTypes(parameterTypes, type => functions.AddFunction(PrimitiveTypeKind.String, "Substring", PrimitiveTypeKind.String, "stringArgument", type, "start", type, "length"));
565functions.ForTypes(parameterTypes, type => functions.AddFunction(PrimitiveTypeKind.String, "Left", PrimitiveTypeKind.String, "stringArgument", type, "length"));
566functions.ForTypes(parameterTypes, type => functions.AddFunction(PrimitiveTypeKind.String, "Right", PrimitiveTypeKind.String, "stringArgument", type, "length"));
568functions.AddFunction(PrimitiveTypeKind.String, "Replace", PrimitiveTypeKind.String, "stringArgument", PrimitiveTypeKind.String, "toReplace", PrimitiveTypeKind.String, "replacement");
569functions.AddFunction(PrimitiveTypeKind.Int32, "IndexOf", PrimitiveTypeKind.String, "searchString", PrimitiveTypeKind.String, "stringToFind");
570functions.AddFunction(PrimitiveTypeKind.String, "ToUpper", PrimitiveTypeKind.String, "stringArgument");
571functions.AddFunction(PrimitiveTypeKind.String, "ToLower", PrimitiveTypeKind.String, "stringArgument");
572functions.AddFunction(PrimitiveTypeKind.String, "Reverse", PrimitiveTypeKind.String, "stringArgument");
573functions.AddFunction(PrimitiveTypeKind.Boolean, "Contains", PrimitiveTypeKind.String, "searchedString", PrimitiveTypeKind.String, "searchedForString");
574functions.AddFunction(PrimitiveTypeKind.Boolean, "StartsWith", PrimitiveTypeKind.String, "stringArgument", PrimitiveTypeKind.String, "prefix");
575functions.AddFunction(PrimitiveTypeKind.Boolean, "EndsWith", PrimitiveTypeKind.String, "stringArgument", PrimitiveTypeKind.String, "suffix");
581PrimitiveTypeKind[] dateTimeParameterTypes = { PrimitiveTypeKind.DateTimeOffset,
582PrimitiveTypeKind.DateTime };
583functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Year", type, "dateValue"));
584functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Month", type, "dateValue"));
585functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Day", type, "dateValue"));
586functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DayOfYear", type, "dateValue"));
588PrimitiveTypeKind[] timeParameterTypes = { PrimitiveTypeKind.DateTimeOffset,
589PrimitiveTypeKind.DateTime,
590PrimitiveTypeKind.Time };
591functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Hour", type, "timeValue"));
592functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Minute", type, "timeValue"));
593functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Second", type, "timeValue"));
594functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "Millisecond", type, "timeValue"));
596functions.AddFunction(PrimitiveTypeKind.DateTime, "CurrentDateTime");
597functions.AddFunction(PrimitiveTypeKind.DateTimeOffset, "CurrentDateTimeOffset");
598functions.AddFunction(PrimitiveTypeKind.Int32, "GetTotalOffsetMinutes", PrimitiveTypeKind.DateTimeOffset, "dateTimeOffsetArgument");
599functions.AddFunction(PrimitiveTypeKind.DateTime, "CurrentUtcDateTime");
605functions.AddFunction(PrimitiveTypeKind.DateTime, "CreateDateTime", PrimitiveTypeKind.Int32, "year",
606PrimitiveTypeKind.Int32, "month",
607PrimitiveTypeKind.Int32, "day",
608PrimitiveTypeKind.Int32, "hour",
609PrimitiveTypeKind.Int32, "minute",
610PrimitiveTypeKind.Double, "second");
614functions.AddFunction(PrimitiveTypeKind.DateTimeOffset, "CreateDateTimeOffset", PrimitiveTypeKind.Int32, "year",
615PrimitiveTypeKind.Int32, "month",
616PrimitiveTypeKind.Int32, "day",
617PrimitiveTypeKind.Int32, "hour",
618PrimitiveTypeKind.Int32, "minute",
619PrimitiveTypeKind.Double, "second",
620PrimitiveTypeKind.Int32, "timeZoneOffset");
623functions.AddFunction(PrimitiveTypeKind.Time, "CreateTime", PrimitiveTypeKind.Int32, "hour", PrimitiveTypeKind.Int32, "minute", PrimitiveTypeKind.Double, "second");
626functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(type, "AddYears", type, "dateValue", PrimitiveTypeKind.Int32, "addValue"));
627functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(type, "AddMonths", type, "dateValue", PrimitiveTypeKind.Int32, "addValue"));
628functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(type, "AddDays", type, "dateValue", PrimitiveTypeKind.Int32, "addValue"));
630functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddHours", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
631functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddMinutes", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
632functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddSeconds", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
633functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddMilliseconds", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
634functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddMicroseconds", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
635functions.ForTypes(timeParameterTypes, type => functions.AddFunction(type, "AddNanoseconds", type, "timeValue", PrimitiveTypeKind.Int32, "addValue"));
638functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffYears", type, "dateValue1", type, "dateValue2"));
639functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffMonths", type, "dateValue1", type, "dateValue2"));
640functions.ForTypes(dateTimeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffDays", type, "dateValue1", type, "dateValue2"));
642functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffHours", type, "timeValue1", type, "timeValue2"));
643functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffMinutes", type, "timeValue1", type, "timeValue2"));
644functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffSeconds", type, "timeValue1", type, "timeValue2"));
645functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffMilliseconds", type, "timeValue1", type, "timeValue2"));
646functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffMicroseconds", type, "timeValue1", type, "timeValue2"));
647functions.ForTypes(timeParameterTypes, type => functions.AddFunction(PrimitiveTypeKind.Int32, "DiffNanoseconds", type, "timeValue1", type, "timeValue2"));
654parameterTypes = new[] { PrimitiveTypeKind.Single,
655PrimitiveTypeKind.Double,
656PrimitiveTypeKind.Decimal };
662parameterTypes = new [] { PrimitiveTypeKind.Double,
663PrimitiveTypeKind.Decimal };
664functions.ForTypes(parameterTypes, type => functions.AddFunction(type, "Round", type, "value", PrimitiveTypeKind.Int32, "digits"));
665functions.ForTypes(parameterTypes, type => functions.AddFunction(type, "Truncate", type, "value", PrimitiveTypeKind.Int32, "digits"));
668parameterTypes = new[] { PrimitiveTypeKind.Decimal,
669PrimitiveTypeKind.Double,
670PrimitiveTypeKind.Int16,
671PrimitiveTypeKind.Int32,
672PrimitiveTypeKind.Int64,
673PrimitiveTypeKind.Byte,
674PrimitiveTypeKind.Single };
678PrimitiveTypeKind[] powerFirstParameterTypes = { PrimitiveTypeKind.Decimal,
679PrimitiveTypeKind.Double,
680PrimitiveTypeKind.Int32,
681PrimitiveTypeKind.Int64};
683PrimitiveTypeKind[] powerSecondParameterTypes = { PrimitiveTypeKind.Decimal,
684PrimitiveTypeKind.Double,
685PrimitiveTypeKind.Int64 };
687foreach (PrimitiveTypeKind kind1 in powerFirstParameterTypes)
689foreach (PrimitiveTypeKind kind2 in powerSecondParameterTypes)
700parameterTypes = new[] { PrimitiveTypeKind.Int16,
701PrimitiveTypeKind.Int32,
702PrimitiveTypeKind.Int64,
703PrimitiveTypeKind.Byte };
714functions.AddFunction(PrimitiveTypeKind.Guid, "NewGuid");
762promotionTypes[(int)PrimitiveTypeKind.Byte] = new System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>(new PrimitiveType[] {
763_primitiveTypes[(int)PrimitiveTypeKind.Byte],
764_primitiveTypes[(int)PrimitiveTypeKind.Int16],
765_primitiveTypes[(int)PrimitiveTypeKind.Int32],
766_primitiveTypes[(int)PrimitiveTypeKind.Int64],
767_primitiveTypes[(int)PrimitiveTypeKind.Decimal],
768_primitiveTypes[(int)PrimitiveTypeKind.Single],
769_primitiveTypes[(int)PrimitiveTypeKind.Double]
775promotionTypes[(int)PrimitiveTypeKind.Int16] = new System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>(new PrimitiveType[] {
776_primitiveTypes[(int)PrimitiveTypeKind.Int16],
777_primitiveTypes[(int)PrimitiveTypeKind.Int32],
778_primitiveTypes[(int)PrimitiveTypeKind.Int64],
779_primitiveTypes[(int)PrimitiveTypeKind.Decimal],
780_primitiveTypes[(int)PrimitiveTypeKind.Single],
781_primitiveTypes[(int)PrimitiveTypeKind.Double]
787promotionTypes[(int)PrimitiveTypeKind.Int32] = new System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>(new PrimitiveType[] {
788_primitiveTypes[(int)PrimitiveTypeKind.Int32],
789_primitiveTypes[(int)PrimitiveTypeKind.Int64],
790_primitiveTypes[(int)PrimitiveTypeKind.Decimal],
791_primitiveTypes[(int)PrimitiveTypeKind.Single],
792_primitiveTypes[(int)PrimitiveTypeKind.Double]
798promotionTypes[(int)PrimitiveTypeKind.Int64] = new System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>(new PrimitiveType[] {
799_primitiveTypes[(int)PrimitiveTypeKind.Int64],
800_primitiveTypes[(int)PrimitiveTypeKind.Decimal],
801_primitiveTypes[(int)PrimitiveTypeKind.Single],
802_primitiveTypes[(int)PrimitiveTypeKind.Double]
808promotionTypes[(int)PrimitiveTypeKind.Single] = new System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>(new PrimitiveType[] {
809_primitiveTypes[(int)PrimitiveTypeKind.Single],
810_primitiveTypes[(int)PrimitiveTypeKind.Double]
815new PrimitiveTypeKind[] {
816PrimitiveTypeKind.GeographyPoint, PrimitiveTypeKind.GeographyLineString, PrimitiveTypeKind.GeographyPolygon,
817PrimitiveTypeKind.GeographyMultiPoint, PrimitiveTypeKind.GeographyMultiLineString, PrimitiveTypeKind.GeographyMultiPolygon,
818PrimitiveTypeKind.GeographyCollection},
819PrimitiveTypeKind.Geography);
823new PrimitiveTypeKind[] {
824PrimitiveTypeKind.GeometryPoint, PrimitiveTypeKind.GeometryLineString, PrimitiveTypeKind.GeometryPolygon,
825PrimitiveTypeKind.GeometryMultiPoint, PrimitiveTypeKind.GeometryMultiLineString, PrimitiveTypeKind.GeometryMultiPolygon,
826PrimitiveTypeKind.GeometryCollection},
827PrimitiveTypeKind.Geometry);
834private void InitializeSpatialPromotionGroup(System.Collections.ObjectModel.ReadOnlyCollection<PrimitiveType>[] promotionTypes, PrimitiveTypeKind[] promotableKinds, PrimitiveTypeKind baseKind)
836foreach (PrimitiveTypeKind promotableKind in promotableKinds)
845internal TypeUsage GetCanonicalModelTypeUsage(PrimitiveTypeKind primitiveTypeKind)
System\Data\Metadata\Edm\Provider\EdmProviderManifestFunctionBuilder.cs (61)
44internal void ForAllTypes(Action<PrimitiveTypeKind> forEachType)
48forEachType((PrimitiveTypeKind)idx);
52internal void ForAllBasePrimitiveTypes(Action<PrimitiveTypeKind> forEachType)
56PrimitiveTypeKind typeKind = (PrimitiveTypeKind)idx;
64internal void ForTypes(IEnumerable<PrimitiveTypeKind> typeKinds, Action<PrimitiveTypeKind> forEachType)
66foreach (PrimitiveTypeKind kind in typeKinds)
72internal void AddAggregate(string aggregateFunctionName, PrimitiveTypeKind collectionArgumentElementTypeKind)
77internal void AddAggregate(PrimitiveTypeKind returnTypeKind, string aggregateFunctionName, PrimitiveTypeKind collectionArgumentElementTypeKind)
101internal void AddFunction(PrimitiveTypeKind returnType, string functionName)
103this.AddFunction(returnType, functionName, new KeyValuePair<string, PrimitiveTypeKind>[] { });
106internal void AddFunction(PrimitiveTypeKind returnType, string functionName, PrimitiveTypeKind argumentTypeKind, string argumentName)
108this.AddFunction(returnType, functionName, new[] { new KeyValuePair<string, PrimitiveTypeKind>(argumentName, argumentTypeKind) });
111internal void AddFunction(PrimitiveTypeKind returnType, string functionName, PrimitiveTypeKind argument1TypeKind, string argument1Name, PrimitiveTypeKind argument2TypeKind, string argument2Name)
114new[] { new KeyValuePair<string, PrimitiveTypeKind>(argument1Name, argument1TypeKind),
115new KeyValuePair<string, PrimitiveTypeKind>(argument2Name, argument2TypeKind)});
118internal void AddFunction(PrimitiveTypeKind returnType, string functionName, PrimitiveTypeKind argument1TypeKind, string argument1Name, PrimitiveTypeKind argument2TypeKind, string argument2Name, PrimitiveTypeKind argument3TypeKind, string argument3Name)
121new[] { new KeyValuePair<string, PrimitiveTypeKind>(argument1Name, argument1TypeKind),
122new KeyValuePair<string, PrimitiveTypeKind>(argument2Name, argument2TypeKind),
123new KeyValuePair<string, PrimitiveTypeKind>(argument3Name, argument3TypeKind)});
126internal void AddFunction(PrimitiveTypeKind returnType, string functionName, PrimitiveTypeKind argument1TypeKind, string argument1Name,
127PrimitiveTypeKind argument2TypeKind, string argument2Name,
128PrimitiveTypeKind argument3TypeKind, string argument3Name,
129PrimitiveTypeKind argument4TypeKind, string argument4Name,
130PrimitiveTypeKind argument5TypeKind, string argument5Name,
131PrimitiveTypeKind argument6TypeKind, string argument6Name)
134new[] { new KeyValuePair<string, PrimitiveTypeKind>(argument1Name, argument1TypeKind),
135new KeyValuePair<string, PrimitiveTypeKind>(argument2Name, argument2TypeKind),
136new KeyValuePair<string, PrimitiveTypeKind>(argument3Name, argument3TypeKind),
137new KeyValuePair<string, PrimitiveTypeKind>(argument4Name, argument4TypeKind),
138new KeyValuePair<string, PrimitiveTypeKind>(argument5Name, argument5TypeKind),
139new KeyValuePair<string, PrimitiveTypeKind>(argument6Name, argument6TypeKind)});
142internal void AddFunction(PrimitiveTypeKind returnType, string functionName, PrimitiveTypeKind argument1TypeKind, string argument1Name,
143PrimitiveTypeKind argument2TypeKind, string argument2Name,
144PrimitiveTypeKind argument3TypeKind, string argument3Name,
145PrimitiveTypeKind argument4TypeKind, string argument4Name,
146PrimitiveTypeKind argument5TypeKind, string argument5Name,
147PrimitiveTypeKind argument6TypeKind, string argument6Name,
148PrimitiveTypeKind argument7TypeKind, string argument7Name)
151new[] { new KeyValuePair<string, PrimitiveTypeKind>(argument1Name, argument1TypeKind),
152new KeyValuePair<string, PrimitiveTypeKind>(argument2Name, argument2TypeKind),
153new KeyValuePair<string, PrimitiveTypeKind>(argument3Name, argument3TypeKind),
154new KeyValuePair<string, PrimitiveTypeKind>(argument4Name, argument4TypeKind),
155new KeyValuePair<string, PrimitiveTypeKind>(argument5Name, argument5TypeKind),
156new KeyValuePair<string, PrimitiveTypeKind>(argument6Name, argument6TypeKind),
157new KeyValuePair<string, PrimitiveTypeKind>(argument7Name, argument7TypeKind)});
160private void AddFunction(PrimitiveTypeKind returnType, string functionName, KeyValuePair<string, PrimitiveTypeKind>[] parameterDefinitions)
181private FunctionParameter CreateParameter(PrimitiveTypeKind primitiveParameterType, string parameterName)
186private FunctionParameter CreateAggregateParameter(PrimitiveTypeKind collectionParameterTypeElementTypeKind)
191private FunctionParameter CreateReturnParameter(PrimitiveTypeKind primitiveReturnType)
System\Data\Metadata\Edm\Provider\EdmProviderManifestSpatialFunctions.cs (294)
30functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromText", PrimitiveTypeKind.String, "geometryText");
31functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromText", PrimitiveTypeKind.String, "geometryText", PrimitiveTypeKind.Int32, "srid");
32functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryPointFromText", PrimitiveTypeKind.String, "pointText", PrimitiveTypeKind.Int32, "srid");
33functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryLineFromText", PrimitiveTypeKind.String, "lineText", PrimitiveTypeKind.Int32, "srid");
34functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryPolygonFromText", PrimitiveTypeKind.String, "polygonText", PrimitiveTypeKind.Int32, "srid");
35functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiPointFromText", PrimitiveTypeKind.String, "multiPointText", PrimitiveTypeKind.Int32, "srid");
36functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiLineFromText", PrimitiveTypeKind.String, "multiLineText", PrimitiveTypeKind.Int32, "srid");
37functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiPolygonFromText", PrimitiveTypeKind.String, "multiPolygonText", PrimitiveTypeKind.Int32, "srid");
38functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryCollectionFromText", PrimitiveTypeKind.String, "geometryCollectionText", PrimitiveTypeKind.Int32, "srid");
39functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromBinary", PrimitiveTypeKind.Binary, "geometryBytes");
40functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromBinary", PrimitiveTypeKind.Binary, "geometryBytes", PrimitiveTypeKind.Int32, "srid");
41functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryPointFromBinary", PrimitiveTypeKind.Binary, "pointBytes", PrimitiveTypeKind.Int32, "srid");
42functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryLineFromBinary", PrimitiveTypeKind.Binary, "lineBytes", PrimitiveTypeKind.Int32, "srid");
43functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryPolygonFromBinary", PrimitiveTypeKind.Binary, "polygonBytes", PrimitiveTypeKind.Int32, "srid");
44functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiPointFromBinary", PrimitiveTypeKind.Binary, "multiPointBytes", PrimitiveTypeKind.Int32, "srid");
45functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiLineFromBinary", PrimitiveTypeKind.Binary, "multiLineBytes", PrimitiveTypeKind.Int32, "srid");
46functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryMultiPolygonFromBinary", PrimitiveTypeKind.Binary, "multiPolygonBytes", PrimitiveTypeKind.Int32, "srid");
47functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryCollectionFromBinary", PrimitiveTypeKind.Binary, "geometryCollectionBytes", PrimitiveTypeKind.Int32, "srid");
48functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromGml", PrimitiveTypeKind.String, "geometryGml");
49functions.AddFunction(PrimitiveTypeKind.Geometry, "GeometryFromGml", PrimitiveTypeKind.String, "geometryGml", PrimitiveTypeKind.Int32, "srid");
50functions.AddFunction(PrimitiveTypeKind.Int32, "CoordinateSystemId", PrimitiveTypeKind.Geometry, "geometryValue");
51functions.AddFunction(PrimitiveTypeKind.String, "SpatialTypeName", PrimitiveTypeKind.Geometry, "geometryValue");
52functions.AddFunction(PrimitiveTypeKind.Int32, "SpatialDimension", PrimitiveTypeKind.Geometry, "geometryValue");
53functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialEnvelope", PrimitiveTypeKind.Geometry, "geometryValue");
54functions.AddFunction(PrimitiveTypeKind.Binary, "AsBinary", PrimitiveTypeKind.Geometry, "geometryValue");
55functions.AddFunction(PrimitiveTypeKind.String, "AsGml", PrimitiveTypeKind.Geometry, "geometryValue");
56functions.AddFunction(PrimitiveTypeKind.String, "AsText", PrimitiveTypeKind.Geometry, "geometryValue");
57functions.AddFunction(PrimitiveTypeKind.Boolean, "IsEmptySpatial", PrimitiveTypeKind.Geometry, "geometryValue");
58functions.AddFunction(PrimitiveTypeKind.Boolean, "IsSimpleGeometry", PrimitiveTypeKind.Geometry, "geometryValue");
59functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialBoundary", PrimitiveTypeKind.Geometry, "geometryValue");
60functions.AddFunction(PrimitiveTypeKind.Boolean, "IsValidGeometry", PrimitiveTypeKind.Geometry, "geometryValue");
61functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialEquals", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
62functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialDisjoint", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
63functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialIntersects", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
64functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialTouches", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
65functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialCrosses", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
66functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialWithin", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
67functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialContains", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
68functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialOverlaps", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
69functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialRelate", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2", PrimitiveTypeKind.String, "matrix");
70functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialBuffer", PrimitiveTypeKind.Geometry, "geometryValue", PrimitiveTypeKind.Double, "distance");
71functions.AddFunction(PrimitiveTypeKind.Double, "Distance", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
72functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialConvexHull", PrimitiveTypeKind.Geometry, "geometryValue");
73functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialIntersection", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
74functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialUnion", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
75functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialDifference", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
76functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialSymmetricDifference", PrimitiveTypeKind.Geometry, "geometryValue1", PrimitiveTypeKind.Geometry, "geometryValue2");
77functions.AddFunction(PrimitiveTypeKind.Int32, "SpatialElementCount", PrimitiveTypeKind.Geometry, "geometryValue");
78functions.AddFunction(PrimitiveTypeKind.Geometry, "SpatialElementAt", PrimitiveTypeKind.Geometry, "geometryValue", PrimitiveTypeKind.Int32, "nValue");
79functions.AddFunction(PrimitiveTypeKind.Double, "XCoordinate", PrimitiveTypeKind.Geometry, "geometryValue");
80functions.AddFunction(PrimitiveTypeKind.Double, "YCoordinate", PrimitiveTypeKind.Geometry, "geometryValue");
81functions.AddFunction(PrimitiveTypeKind.Double, "Elevation", PrimitiveTypeKind.Geometry, "geometryValue");
82functions.AddFunction(PrimitiveTypeKind.Double, "Measure", PrimitiveTypeKind.Geometry, "geometryValue");
83functions.AddFunction(PrimitiveTypeKind.Double, "SpatialLength", PrimitiveTypeKind.Geometry, "geometryValue");
84functions.AddFunction(PrimitiveTypeKind.Geometry, "StartPoint", PrimitiveTypeKind.Geometry, "geometryValue");
85functions.AddFunction(PrimitiveTypeKind.Geometry, "EndPoint", PrimitiveTypeKind.Geometry, "geometryValue");
86functions.AddFunction(PrimitiveTypeKind.Boolean, "IsClosedSpatial", PrimitiveTypeKind.Geometry, "geometryValue");
87functions.AddFunction(PrimitiveTypeKind.Boolean, "IsRing", PrimitiveTypeKind.Geometry, "geometryValue");
88functions.AddFunction(PrimitiveTypeKind.Int32, "PointCount", PrimitiveTypeKind.Geometry, "geometryValue");
89functions.AddFunction(PrimitiveTypeKind.Geometry, "PointAt", PrimitiveTypeKind.Geometry, "geometryValue", PrimitiveTypeKind.Int32, "nValue");
90functions.AddFunction(PrimitiveTypeKind.Double, "Area", PrimitiveTypeKind.Geometry, "geometryValue");
91functions.AddFunction(PrimitiveTypeKind.Geometry, "Centroid", PrimitiveTypeKind.Geometry, "geometryValue");
92functions.AddFunction(PrimitiveTypeKind.Geometry, "PointOnSurface", PrimitiveTypeKind.Geometry, "geometryValue");
93functions.AddFunction(PrimitiveTypeKind.Geometry, "ExteriorRing", PrimitiveTypeKind.Geometry, "geometryValue");
94functions.AddFunction(PrimitiveTypeKind.Int32, "InteriorRingCount", PrimitiveTypeKind.Geometry, "geometryValue");
95functions.AddFunction(PrimitiveTypeKind.Geometry, "InteriorRingAt", PrimitiveTypeKind.Geometry, "geometryValue", PrimitiveTypeKind.Int32, "nValue");
98functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromText", PrimitiveTypeKind.String, "geographyText");
99functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromText", PrimitiveTypeKind.String, "geographyText", PrimitiveTypeKind.Int32, "srid");
100functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyPointFromText", PrimitiveTypeKind.String, "pointText", PrimitiveTypeKind.Int32, "srid");
101functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyLineFromText", PrimitiveTypeKind.String, "lineText", PrimitiveTypeKind.Int32, "srid");
102functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyPolygonFromText", PrimitiveTypeKind.String, "polygonText", PrimitiveTypeKind.Int32, "srid");
103functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiPointFromText", PrimitiveTypeKind.String, "multiPointText", PrimitiveTypeKind.Int32, "srid");
104functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiLineFromText", PrimitiveTypeKind.String, "multiLineText", PrimitiveTypeKind.Int32, "srid");
105functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiPolygonFromText", PrimitiveTypeKind.String, "multiPolygonText", PrimitiveTypeKind.Int32, "srid");
106functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyCollectionFromText", PrimitiveTypeKind.String, "geographyCollectionText", PrimitiveTypeKind.Int32, "srid");
107functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromBinary", PrimitiveTypeKind.Binary, "geographyBytes", PrimitiveTypeKind.Int32, "srid");
108functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromBinary", PrimitiveTypeKind.Binary, "geographyBytes");
109functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyPointFromBinary", PrimitiveTypeKind.Binary, "pointBytes", PrimitiveTypeKind.Int32, "srid");
110functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyLineFromBinary", PrimitiveTypeKind.Binary, "lineBytes", PrimitiveTypeKind.Int32, "srid");
111functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyPolygonFromBinary", PrimitiveTypeKind.Binary, "polygonBytes", PrimitiveTypeKind.Int32, "srid");
112functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiPointFromBinary", PrimitiveTypeKind.Binary, "multiPointBytes", PrimitiveTypeKind.Int32, "srid");
113functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiLineFromBinary", PrimitiveTypeKind.Binary, "multiLineBytes", PrimitiveTypeKind.Int32, "srid");
114functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyMultiPolygonFromBinary", PrimitiveTypeKind.Binary, "multiPolygonBytes", PrimitiveTypeKind.Int32, "srid");
115functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyCollectionFromBinary", PrimitiveTypeKind.Binary, "geographyCollectionBytes", PrimitiveTypeKind.Int32, "srid");
116functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromGml", PrimitiveTypeKind.String, "geographyGml");
117functions.AddFunction(PrimitiveTypeKind.Geography, "GeographyFromGml", PrimitiveTypeKind.String, "geographyGml", PrimitiveTypeKind.Int32, "srid");
118functions.AddFunction(PrimitiveTypeKind.Int32, "CoordinateSystemId", PrimitiveTypeKind.Geography, "geographyValue");
119functions.AddFunction(PrimitiveTypeKind.String, "SpatialTypeName", PrimitiveTypeKind.Geography, "geographyValue");
120functions.AddFunction(PrimitiveTypeKind.Int32, "SpatialDimension", PrimitiveTypeKind.Geography, "geographyValue");
121functions.AddFunction(PrimitiveTypeKind.Binary, "AsBinary", PrimitiveTypeKind.Geography, "geographyValue");
122functions.AddFunction(PrimitiveTypeKind.String, "AsGml", PrimitiveTypeKind.Geography, "geographyValue");
123functions.AddFunction(PrimitiveTypeKind.String, "AsText", PrimitiveTypeKind.Geography, "geographyValue");
124functions.AddFunction(PrimitiveTypeKind.Boolean, "IsEmptySpatial", PrimitiveTypeKind.Geography, "geographyValue");
125functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialEquals", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
126functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialDisjoint", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
127functions.AddFunction(PrimitiveTypeKind.Boolean, "SpatialIntersects", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
128functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialBuffer", PrimitiveTypeKind.Geography, "geographyValue", PrimitiveTypeKind.Double, "distance");
129functions.AddFunction(PrimitiveTypeKind.Double, "Distance", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
130functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialIntersection", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
131functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialUnion", PrimitiveTypeKind.Geography, "geographyValue1", PrimitiveTypeKind.Geography, "geographyValue2");
132functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialDifference", PrimitiveTypeKind.Geography, "geometryValue1", PrimitiveTypeKind.Geography, "geometryValue2");
133functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialSymmetricDifference", PrimitiveTypeKind.Geography, "geometryValue1", PrimitiveTypeKind.Geography, "geometryValue2");
134functions.AddFunction(PrimitiveTypeKind.Int32, "SpatialElementCount", PrimitiveTypeKind.Geography, "geographyValue");
135functions.AddFunction(PrimitiveTypeKind.Geography, "SpatialElementAt", PrimitiveTypeKind.Geography, "geographyValue", PrimitiveTypeKind.Int32, "nValue");
136functions.AddFunction(PrimitiveTypeKind.Double, "Latitude", PrimitiveTypeKind.Geography, "geographyValue");
137functions.AddFunction(PrimitiveTypeKind.Double, "Longitude", PrimitiveTypeKind.Geography, "geographyValue");
138functions.AddFunction(PrimitiveTypeKind.Double, "Elevation", PrimitiveTypeKind.Geography, "geographyValue");
139functions.AddFunction(PrimitiveTypeKind.Double, "Measure", PrimitiveTypeKind.Geography, "geographyValue");
140functions.AddFunction(PrimitiveTypeKind.Double, "SpatialLength", PrimitiveTypeKind.Geography, "geographyValue");
141functions.AddFunction(PrimitiveTypeKind.Geography, "StartPoint", PrimitiveTypeKind.Geography, "geographyValue");
142functions.AddFunction(PrimitiveTypeKind.Geography, "EndPoint", PrimitiveTypeKind.Geography, "geographyValue");
143functions.AddFunction(PrimitiveTypeKind.Boolean, "IsClosedSpatial", PrimitiveTypeKind.Geography, "geographyValue");
144functions.AddFunction(PrimitiveTypeKind.Int32, "PointCount", PrimitiveTypeKind.Geography, "geographyValue");
145functions.AddFunction(PrimitiveTypeKind.Geography, "PointAt", PrimitiveTypeKind.Geography, "geographyValue", PrimitiveTypeKind.Int32, "nValue");
146functions.AddFunction(PrimitiveTypeKind.Double, "Area", PrimitiveTypeKind.Geography, "geographyValue");
System\Data\Metadata\Helper.cs (32)
405internal static bool IsGeographicTypeKind(PrimitiveTypeKind kind)
407return kind == PrimitiveTypeKind.Geography || IsStrongGeographicTypeKind(kind);
415internal static bool IsGeometricTypeKind(PrimitiveTypeKind kind)
417return kind == PrimitiveTypeKind.Geometry || IsStrongGeometricTypeKind(kind);
420internal static bool IsStrongSpatialTypeKind(PrimitiveTypeKind kind)
425static bool IsStrongGeometricTypeKind(PrimitiveTypeKind kind)
427return kind >= PrimitiveTypeKind.GeometryPoint && kind <= PrimitiveTypeKind.GeometryCollection;
430static bool IsStrongGeographicTypeKind(PrimitiveTypeKind kind)
432return kind >= PrimitiveTypeKind.GeographyPoint && kind <= PrimitiveTypeKind.GeographyCollection;
440internal static bool IsSpatialType(TypeUsage type, out PrimitiveTypeKind spatialType)
452spatialType = default(PrimitiveTypeKind);
500/// <see cref="PrimitiveTypeKind"/> to verifiy.
505internal static bool IsSupportedEnumUnderlyingType(PrimitiveTypeKind typeKind)
507return typeKind == PrimitiveTypeKind.Byte ||
508typeKind == PrimitiveTypeKind.SByte ||
509typeKind == PrimitiveTypeKind.Int16 ||
510typeKind == PrimitiveTypeKind.Int32 ||
511typeKind == PrimitiveTypeKind.Int64;
514private static readonly Dictionary<PrimitiveTypeKind, long[]> _enumUnderlyingTypeRanges =
515new Dictionary<PrimitiveTypeKind, long[]>
517{ PrimitiveTypeKind.Byte, new long[] { Byte.MinValue, Byte.MaxValue } },
518{ PrimitiveTypeKind.SByte, new long[] { SByte.MinValue, SByte.MaxValue } },
519{ PrimitiveTypeKind.Int16, new long[] { Int16.MinValue, Int16.MaxValue } },
520{ PrimitiveTypeKind.Int32, new long[] { Int32.MinValue, Int32.MaxValue } },
521{ PrimitiveTypeKind.Int64, new long[] { Int64.MinValue, Int64.MaxValue } },
532internal static bool IsEnumMemberValueInRange(PrimitiveTypeKind underlyingTypeKind, long value)
575if (IsGeographicType(primitiveType) && primitiveType.PrimitiveTypeKind != PrimitiveTypeKind.Geography)
577return PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Geography);
579else if (IsGeometricType(primitiveType) && primitiveType.PrimitiveTypeKind != PrimitiveTypeKind.Geometry)
581return PrimitiveType.GetEdmPrimitiveType(PrimitiveTypeKind.Geometry);
System\Data\SqlClient\SqlGen\SqlFunctionCallHandler.cs (20)
449string functionNameWithSrid = (TypeSemantics.IsPrimitiveType(functionExpression.ResultType, PrimitiveTypeKind.Geometry) ? "geometry::STGeomFromText" : "geography::STGeomFromText");
450string functionNameWithoutSrid = (TypeSemantics.IsPrimitiveType(functionExpression.ResultType, PrimitiveTypeKind.Geometry) ? "geometry::Parse" : "geography::Parse");
466return HandleSpatialStaticMethodFunctionAppendSrid(sqlgen, functionExpression, (TypeSemantics.IsPrimitiveType(functionExpression.ResultType, PrimitiveTypeKind.Geometry) ? "geometry::GeomFromGml" : "geography::GeomFromGml"));
471return HandleSpatialStaticMethodFunctionAppendSrid(sqlgen, functionExpression, (TypeSemantics.IsPrimitiveType(functionExpression.ResultType, PrimitiveTypeKind.Geometry) ? "geometry::STGeomFromWKB" : "geography::STGeomFromWKB"));
485DbExpression sridExpression = (TypeSemantics.IsPrimitiveType(functionExpression.ResultType, PrimitiveTypeKind.Geometry) ? defaultGeometrySridExpression : defaultGeographySridExpression);
510PrimitiveTypeKind spatialTypeKind;
549private static bool IsSpatialCanonicalFunction(DbFunctionExpression e, out PrimitiveTypeKind spatialTypeKind)
567spatialTypeKind = default(PrimitiveTypeKind);
742private static ISqlFragment HandleSpatialCanonicalFunction(SqlGenerator sqlgen, DbFunctionExpression functionExpression, PrimitiveTypeKind spatialTypeKind)
744Debug.Assert(spatialTypeKind == PrimitiveTypeKind.Geography || spatialTypeKind == PrimitiveTypeKind.Geometry, "Spatial function does not refer to a valid spatial primitive type kind?");
745if (spatialTypeKind == PrimitiveTypeKind.Geography)
1220PrimitiveTypeKind typeKind;
1224if (typeKind == PrimitiveTypeKind.DateTime)
1228else if (typeKind == PrimitiveTypeKind.DateTimeOffset)
1448if (TypeSemantics.IsPrimitiveType(e.Arguments[0].ResultType, PrimitiveTypeKind.Byte))
1753return CastReturnTypeToGivenType(e, _functionRequiresReturnTypeCastToInt64, PrimitiveTypeKind.Int64);
1786return CastReturnTypeToGivenType(e, _functionRequiresReturnTypeCastToInt16, PrimitiveTypeKind.Int16);
1799return CastReturnTypeToGivenType(e, _functionRequiresReturnTypeCastToSingle, PrimitiveTypeKind.Single);
1809private static bool CastReturnTypeToGivenType(DbFunctionExpression e, Set<string> functionsRequiringReturnTypeCast, PrimitiveTypeKind type)
System\Data\SqlClient\SqlGen\SqlGenerator.cs (47)
361integerType = GetPrimitiveType(PrimitiveTypeKind.Int64);
374defaultStringTypeName = GetSqlPrimitiveType(TypeUsage.CreateStringTypeUsage(this.metadataWorkspace.GetModelPrimitiveType(PrimitiveTypeKind.String), isUnicode: true, isFixedLength: false));
728if (TypeSemantics.IsPrimitiveType(e.Left.ResultType, PrimitiveTypeKind.String))
885if (!TypeSemantics.IsPrimitiveType(type, PrimitiveTypeKind.String))
909PrimitiveTypeKind typeKind;
916case PrimitiveTypeKind.Int32:
921case PrimitiveTypeKind.Binary:
927case PrimitiveTypeKind.Boolean:
933case PrimitiveTypeKind.Byte:
937case PrimitiveTypeKind.DateTime:
945case PrimitiveTypeKind.Time:
954case PrimitiveTypeKind.DateTimeOffset:
963case PrimitiveTypeKind.Decimal:
978case PrimitiveTypeKind.Double:
986case PrimitiveTypeKind.Geography:
990case PrimitiveTypeKind.Geometry:
994case PrimitiveTypeKind.Guid:
998case PrimitiveTypeKind.Int16:
1002case PrimitiveTypeKind.Int64:
1006case PrimitiveTypeKind.Single:
1014case PrimitiveTypeKind.String:
1092throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNaNNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double)));
1096throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedPositiveInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double), typeof(Double).Name));
1100throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNegativeInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Double), typeof(Double).Name));
1113throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNaNNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single)));
1117throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedPositiveInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single), typeof(Single).Name));
1121throw EntityUtil.NotSupported(System.Data.Entity.Strings.SqlGen_TypedNegativeInfinityNotSupported(Enum.GetName(typeof(PrimitiveTypeKind), PrimitiveTypeKind.Single), typeof(Single).Name));
1808if (TypeSemantics.IsPrimitiveType(comparisonExpression.Left.ResultType, PrimitiveTypeKind.String))
1846case PrimitiveTypeKind.String:
1849case PrimitiveTypeKind.Binary:
1931if (TypeSemantics.IsPrimitiveType(key.ResultType, PrimitiveTypeKind.String))
3832PrimitiveTypeKind primitiveTypeKind = ((PrimitiveType)storeTypeUsage.EdmType).PrimitiveTypeKind;
3836case PrimitiveTypeKind.Binary:
3845case PrimitiveTypeKind.String:
3854case PrimitiveTypeKind.DateTime:
3857case PrimitiveTypeKind.Time:
3861case PrimitiveTypeKind.DateTimeOffset:
3866case PrimitiveTypeKind.Decimal:
4223private TypeUsage GetPrimitiveType(PrimitiveTypeKind modelType)
4367private void AssertKatmaiOrNewer(PrimitiveTypeKind primitiveTypeKind)
4372private static void AssertKatmaiOrNewer(SqlVersion sqlVersion, PrimitiveTypeKind primitiveTypeKind)
System\Data\SqlClient\SqlProviderManifest.cs (45)
357PrimitiveTypeKind newPrimitiveTypeKind;
373newPrimitiveTypeKind = PrimitiveTypeKind.String;
380newPrimitiveTypeKind = PrimitiveTypeKind.String;
387newPrimitiveTypeKind = PrimitiveTypeKind.String;
394newPrimitiveTypeKind = PrimitiveTypeKind.String;
402newPrimitiveTypeKind = PrimitiveTypeKind.String;
411newPrimitiveTypeKind = PrimitiveTypeKind.String;
418newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
424newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
431newPrimitiveTypeKind = PrimitiveTypeKind.Binary;
480Debug.Assert(newPrimitiveTypeKind == PrimitiveTypeKind.String || newPrimitiveTypeKind == PrimitiveTypeKind.Binary, "at this point only string and binary types should be present");
484case PrimitiveTypeKind.String:
493case PrimitiveTypeKind.Binary:
528case PrimitiveTypeKind.Boolean:
531case PrimitiveTypeKind.Byte:
534case PrimitiveTypeKind.Int16:
537case PrimitiveTypeKind.Int32:
540case PrimitiveTypeKind.Int64:
543case PrimitiveTypeKind.Geography:
544case PrimitiveTypeKind.GeographyPoint:
545case PrimitiveTypeKind.GeographyLineString:
546case PrimitiveTypeKind.GeographyPolygon:
547case PrimitiveTypeKind.GeographyMultiPoint:
548case PrimitiveTypeKind.GeographyMultiLineString:
549case PrimitiveTypeKind.GeographyMultiPolygon:
550case PrimitiveTypeKind.GeographyCollection:
553case PrimitiveTypeKind.Geometry:
554case PrimitiveTypeKind.GeometryPoint:
555case PrimitiveTypeKind.GeometryLineString:
556case PrimitiveTypeKind.GeometryPolygon:
557case PrimitiveTypeKind.GeometryMultiPoint:
558case PrimitiveTypeKind.GeometryMultiLineString:
559case PrimitiveTypeKind.GeometryMultiPolygon:
560case PrimitiveTypeKind.GeometryCollection:
563case PrimitiveTypeKind.Guid:
566case PrimitiveTypeKind.Double:
569case PrimitiveTypeKind.Single:
572case PrimitiveTypeKind.Decimal: // decimal, numeric, smallmoney, money
589case PrimitiveTypeKind.Binary: // binary, varbinary, varbinary(max), image, timestamp, rowversion
624case PrimitiveTypeKind.String:
698case PrimitiveTypeKind.DateTime:
700case PrimitiveTypeKind.DateTimeOffset:
702case PrimitiveTypeKind.Time:
710private TypeUsage GetStorePrimitiveTypeIfPostSql9(string storeTypeName, string edmTypeIdentity, PrimitiveTypeKind primitiveTypeKind)