blob: 2a9a718bbf10f13d6c319193d40525eacb6ac6d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
//------------------------------------------------------------------------------
// <copyright file="SqlSpatialServices.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//
// @owner willa
// @backupOwner Microsoft
//------------------------------------------------------------------------------
namespace System.Data.Spatial.Internal
{
using System;
using System.Data;
internal static class SpatialExceptions
{
internal static ArgumentNullException ArgumentNull(string argumentName)
{
//
return EntityUtil.ArgumentNull(argumentName);
}
internal static Exception ProviderValueNotCompatibleWithSpatialServices()
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_ProviderValueNotCompatibleWithSpatialServices, "providerValue");
}
/// <summary>
/// Thrown whenever DbGeograpy/DbGeometry.WellKnownValue is set after regular construction (not deserialization instantiation).
/// </summary>
/// <returns><see cref="InvalidOperationException"/></returns>
internal static InvalidOperationException WellKnownValueSerializationPropertyNotDirectlySettable()
{
//
return EntityUtil.InvalidOperation(System.Data.Entity.Strings.Spatial_WellKnownValueSerializationPropertyNotDirectlySettable);
}
#region Geography-specific exceptions
internal static Exception GeographyValueNotCompatibleWithSpatialServices(string argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_GeographyValueNotCompatibleWithSpatialServices, argumentName);
}
internal static Exception WellKnownGeographyValueNotValid(string argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_WellKnownGeographyValueNotValid, argumentName);
}
internal static Exception CouldNotCreateWellKnownGeographyValueNoSrid(string argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoSrid, argumentName);
}
internal static Exception CouldNotCreateWellKnownGeographyValueNoWkbOrWkt(string argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoWkbOrWkt, argumentName);
}
#endregion
#region Geometry-specific exceptions
internal static Exception GeometryValueNotCompatibleWithSpatialServices(string argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_GeometryValueNotCompatibleWithSpatialServices, argumentName);
}
internal static Exception WellKnownGeometryValueNotValid(string argumentName)
{
//
throw EntityUtil.Argument(System.Data.Entity.Strings.Spatial_WellKnownGeometryValueNotValid, argumentName);
}
internal static Exception CouldNotCreateWellKnownGeometryValueNoSrid(String argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoSrid, argumentName);
}
internal static Exception CouldNotCreateWellKnownGeometryValueNoWkbOrWkt(String argumentName)
{
//
return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoWkbOrWkt, argumentName);
}
#endregion
#region SqlSpatialServices-specific Exceptions
internal static Exception SqlSpatialServices_ProviderValueNotSqlType(Type requiredType)
{
return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialServices_ProviderValueNotSqlType(requiredType.AssemblyQualifiedName), "providerValue");
}
#endregion
}
}
|