You've already forked linux-packaging-mono
Imported Upstream version 6.4.0.137
Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
parent
e9207cf623
commit
ef583813eb
@@ -68,6 +68,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
|
||||
// Test constructor
|
||||
[Test]
|
||||
[Category("AndroidSdksNotWorking")]
|
||||
public void Create()
|
||||
{
|
||||
// SqlString (String)
|
||||
@@ -342,6 +343,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category("AndroidSdksNotWorking")]
|
||||
public void UnicodeBytes()
|
||||
{
|
||||
Assert.AreEqual ((byte)105, Test1.GetNonUnicodeBytes () [1], "#N01");
|
||||
@@ -597,6 +599,7 @@ namespace MonoTests.System.Data.SqlTypes
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Category ("Calendars")]
|
||||
public void SqlDateTimeToSqlString()
|
||||
{
|
||||
SqlDateTime TestTime = new SqlDateTime(2002, 10, 22, 9, 52, 30);
|
||||
|
||||
@@ -1 +1 @@
|
||||
cb15d8ba56678e66fd3473fef709b88a22cb9f48
|
||||
9e3f2c87c431bdde07229b674330d6ab900d189d
|
||||
@@ -1 +1 @@
|
||||
17d4d876434b0d3eb0723be53b58711ebcaa6f61
|
||||
adc3c36f464f5483c73a2a1646e5bd9c2ad1e4b9
|
||||
@@ -24,6 +24,7 @@ corefx/SqlParameterCollection.cs
|
||||
corefx/TdsEnums.cs
|
||||
corefx/SR.cs
|
||||
corefx/SqlDependencyUtils.cs
|
||||
corefx/DataReaderExtensions.cs
|
||||
../referencesource/System.Data/System/Data/Sql/SqlDataSourceEnumerator.cs
|
||||
../referencesource/System.Data/System/Data/CodeGen/StrongTypingException.cs
|
||||
../referencesource/System.Data/System/Data/OleDb/PropertyAttributes.cs
|
||||
@@ -465,3 +466,4 @@ corefx/SqlDependencyUtils.cs
|
||||
../../../external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs
|
||||
../../../external/corefx/src/System.Data.Odbc/src/Common/System/Data/Common/SafeNativeMethods.cs
|
||||
../../../external/corefx/src/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbBuffer.cs
|
||||
corefx/DbProviderFactories.mobile.cs
|
||||
|
||||
183
mcs/class/System.Data/corefx/DataReaderExtensions.cs
Normal file
183
mcs/class/System.Data/corefx/DataReaderExtensions.cs
Normal file
@@ -0,0 +1,183 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Data.Common;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace System.Data
|
||||
{
|
||||
// copied from CoreFX (NS2.1)
|
||||
public static class DataReaderExtensions
|
||||
{
|
||||
public static bool GetBoolean(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetBoolean(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static byte GetByte(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetByte(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static long GetBytes(this DbDataReader reader, string name, long dataOffset, byte[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetBytes(reader.GetOrdinal(name), dataOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
|
||||
public static char GetChar(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetChar(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static long GetChars(this DbDataReader reader, string name, long dataOffset, char[] buffer, int bufferOffset, int length)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetChars(reader.GetOrdinal(name), dataOffset, buffer, bufferOffset, length);
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static DbDataReader GetData(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetData(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static string GetDataTypeName(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetDataTypeName(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static DateTime GetDateTime(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetDateTime(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static decimal GetDecimal(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetDecimal(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static double GetDouble(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetDouble(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static Type GetFieldType(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetFieldType(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static T GetFieldValue<T>(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetFieldValue<T>(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static Task<T> GetFieldValueAsync<T>(this DbDataReader reader, string name, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetFieldValueAsync<T>(reader.GetOrdinal(name), cancellationToken);
|
||||
}
|
||||
|
||||
public static float GetFloat(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetFloat(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static Guid GetGuid(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetGuid(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static short GetInt16(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetInt16(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static int GetInt32(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetInt32(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static long GetInt64(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetInt64(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static Type GetProviderSpecificFieldType(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetProviderSpecificFieldType(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static object GetProviderSpecificValue(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetProviderSpecificValue(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static Stream GetStream(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetStream(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static string GetString(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetString(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static TextReader GetTextReader(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetTextReader(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static object GetValue(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.GetValue(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static bool IsDBNull(this DbDataReader reader, string name)
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.IsDBNull(reader.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public static Task<bool> IsDBNullAsync(this DbDataReader reader, string name, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
AssertNotNull(reader);
|
||||
return reader.IsDBNullAsync(reader.GetOrdinal(name), cancellationToken);
|
||||
}
|
||||
|
||||
private static void AssertNotNull(DbDataReader reader)
|
||||
{
|
||||
if (reader == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
21
mcs/class/System.Data/corefx/DbProviderFactories.mobile.cs
Normal file
21
mcs/class/System.Data/corefx/DbProviderFactories.mobile.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
#if MOBILE
|
||||
namespace System.Data.Common
|
||||
{
|
||||
public static partial class DbProviderFactories
|
||||
{
|
||||
public static System.Data.Common.DbProviderFactory GetFactory(System.Data.Common.DbConnection connection) => throw new PlatformNotSupportedException();
|
||||
public static System.Data.Common.DbProviderFactory GetFactory(System.Data.DataRow providerRow) => throw new PlatformNotSupportedException();
|
||||
public static System.Data.Common.DbProviderFactory GetFactory(string providerInvariantName) => throw new PlatformNotSupportedException();
|
||||
public static System.Data.DataTable GetFactoryClasses() => throw new PlatformNotSupportedException();
|
||||
public static System.Collections.Generic.IEnumerable<string> GetProviderInvariantNames() => throw new PlatformNotSupportedException();
|
||||
public static void RegisterFactory(string providerInvariantName, System.Data.Common.DbProviderFactory factory) => throw new PlatformNotSupportedException();
|
||||
public static void RegisterFactory(string providerInvariantName, string factoryTypeAssemblyQualifiedName) => throw new PlatformNotSupportedException();
|
||||
public static void RegisterFactory(string providerInvariantName, System.Type providerFactoryClass) => throw new PlatformNotSupportedException();
|
||||
public static bool TryGetFactory(string providerInvariantName, out System.Data.Common.DbProviderFactory factory) => throw new PlatformNotSupportedException();
|
||||
public static bool UnregisterFactory(string providerInvariantName) => throw new PlatformNotSupportedException();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user