コード例 #1
0
        internal DbGeometry(DbSpatialServices spatialServices, object spatialProviderValue)
        {
            Contract.Requires(spatialServices != null);
            Contract.Requires(spatialProviderValue != null);

            _spatialProvider = spatialServices;
            _providerValue = spatialProviderValue;
        }
コード例 #2
0
        internal DbGeography(DbSpatialServices spatialServices, object spatialProviderValue)
        {
            DebugCheck.NotNull(spatialServices);
            DebugCheck.NotNull(spatialProviderValue);

            _spatialProvider = spatialServices;
            _providerValue = spatialProviderValue;
        }
コード例 #3
0
        internal SqlSpatialDataReader(DbSpatialServices spatialServices, SqlDataReaderWrapper underlyingReader)
        {
            _spatialServices = spatialServices;
            _reader = underlyingReader;

            var fieldCount = _reader.FieldCount;
            _geographyColumns = new bool[fieldCount];
            _geometryColumns = new bool[fieldCount];
            for (var i = 0; i < _reader.FieldCount; i++)
            {
                var fieldTypeName = _reader.GetDataTypeName(i);
                // Use EndsWith so that we just see the schema and type name, not the database name.
                if (fieldTypeName.EndsWith(GeographySqlType, StringComparison.Ordinal))
                {
                    _geographyColumns[i] = true;
                }
                else if (fieldTypeName.EndsWith(GeometrySqlType, StringComparison.Ordinal))
                {
                    _geometryColumns[i] = true;
                }
            }
        }
コード例 #4
0
 /// <summary>
 ///     This method is intended for use by derived implementations of
 ///     <see
 ///         cref="M:System.Data.Entity.Spatial.DbSpatialServices.GeographyFromProviderValue(System.Object)" />
 ///     after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation.
 /// </summary>
 /// <returns>
 ///     A new <see cref="T:System.Data.Entity.Spatial.DbGeography" /> instance that contains the specified providerValue and uses the specified spatialServices as its spatial implementation.
 /// </returns>
 /// <param name="spatialServices">
 ///     The spatial services instance that the returned <see cref="T:System.Data.Entity.Spatial.DbGeography" /> value will depend on for its implementation of spatial functionality.
 /// </param>
 /// <param name="providerValue">The provider value.</param>
 protected static DbGeography CreateGeography(DbSpatialServices spatialServices, object providerValue)
 {
     Check.NotNull(spatialServices, "spatialServices");
     Check.NotNull(providerValue, "providerValue");
     return new DbGeography(spatialServices, providerValue);
 }
コード例 #5
0
 /// <summary>
 /// This method is intended for use by derived implementations of <see cref="GeometryFromProviderValue"/> after suitable validation of the specified provider value to ensure it is suitable for use with the derived implementation.
 /// </summary>
 /// <param name="spatialServices">The spatial services instance that the returned <see cref="DbGeometry"/> value will depend on for its implementation of spatial functionality.</param>
 /// <param name="providerValue"></param>
 /// <returns>A new <see cref="DbGeometry"/> instance that contains the specified <paramref name="providerValue"/> and uses the specified <paramref name="spatialServices"/> as its spatial implementation</returns>
 /// <exception cref="ArgumentNullException"><paramref name="spatialServices"/> or <paramref name="providerValue"/> is null.</exception>
 protected static DbGeometry CreateGeometry(DbSpatialServices spatialServices, object providerValue)
 {
     spatialServices.CheckNull("spatialServices");
     providerValue.CheckNull("providerValue");
     return new DbGeometry(spatialServices, providerValue);
 }
コード例 #6
0
 internal SqlSpatialDataReader(DbSpatialServices spatialServices, SqlDataReaderWrapper underlyingReader)
 {
     _spatialServices = spatialServices;
     _reader = underlyingReader;
 }