Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
05cd5344
Commit
05cd5344
authored
Nov 18, 2015
by
Sebastien Ros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrading platform monikers
parent
8ececb4e
Changes
35
Hide whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
71 additions
and
101 deletions
+71
-101
Assert.cs
Dapper.DNX.Tests/Assert.cs
+1
-1
Program.cs
Dapper.DNX.Tests/Program.cs
+3
-3
Tests.Async.cs
Dapper.DNX.Tests/Tests.Async.cs
+1
-1
Tests.cs
Dapper.DNX.Tests/Tests.cs
+9
-9
project.json
Dapper.DNX.Tests/project.json
+1
-12
project.json
Dapper.StrongName/project.json
+1
-10
CommandDefinition.cs
Dapper/CommandDefinition.cs
+1
-1
DataTableHandler.cs
Dapper/DataTableHandler.cs
+1
-1
DbString.cs
Dapper/DbString.cs
+1
-1
DefaultTypeMap.cs
Dapper/DefaultTypeMap.cs
+3
-3
DynamicParameters.CachedOutputSetters.cs
Dapper/DynamicParameters.CachedOutputSetters.cs
+1
-1
DynamicParameters.ParamInfo.cs
Dapper/DynamicParameters.ParamInfo.cs
+1
-1
DynamicParameters.cs
Dapper/DynamicParameters.cs
+2
-2
FeatureSupport.cs
Dapper/FeatureSupport.cs
+1
-1
SqlDataRecordHandler.cs
Dapper/SqlDataRecordHandler.cs
+1
-1
SqlDataRecordListTVPParameter.cs
Dapper/SqlDataRecordListTVPParameter.cs
+1
-1
SqlMapper.Async.cs
Dapper/SqlMapper.Async.cs
+1
-1
SqlMapper.CacheInfo.cs
Dapper/SqlMapper.CacheInfo.cs
+1
-1
SqlMapper.DeserializerState.cs
Dapper/SqlMapper.DeserializerState.cs
+1
-1
SqlMapper.GridReader.Async.cs
Dapper/SqlMapper.GridReader.Async.cs
+1
-1
SqlMapper.GridReader.cs
Dapper/SqlMapper.GridReader.cs
+1
-1
SqlMapper.ICustomQueryParameter.cs
Dapper/SqlMapper.ICustomQueryParameter.cs
+1
-1
SqlMapper.IDynamicParameters.cs
Dapper/SqlMapper.IDynamicParameters.cs
+1
-1
SqlMapper.ITypeHandler.cs
Dapper/SqlMapper.ITypeHandler.cs
+1
-1
SqlMapper.Identity.cs
Dapper/SqlMapper.Identity.cs
+1
-1
SqlMapper.TypeHandler.cs
Dapper/SqlMapper.TypeHandler.cs
+1
-1
SqlMapper.TypeHandlerCache.cs
Dapper/SqlMapper.TypeHandlerCache.cs
+2
-2
SqlMapper.cs
Dapper/SqlMapper.cs
+18
-18
TableValuedParameter.cs
Dapper/TableValuedParameter.cs
+1
-1
TypeExtensions.cs
Dapper/TypeExtensions.cs
+4
-4
UdtTypeHandler.cs
Dapper/UdtTypeHandler.cs
+1
-1
WrappedDataReader.cs
Dapper/WrappedDataReader.cs
+2
-2
WrappedReader.cs
Dapper/WrappedReader.cs
+2
-2
project.json
Dapper/project.json
+1
-11
global.json
global.json
+1
-1
No files found.
Dapper.DNX.Tests/Assert.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
#if D
NXCORE50
#if D
OTNET5_2
using
ApplicationException
=
System
.
InvalidOperationException
;
#endif
...
...
Dapper.DNX.Tests/Program.cs
View file @
05cd5344
...
...
@@ -71,7 +71,7 @@ static void RunPerformanceTests()
static
void
Main
()
{
#if D
NXCORE50
#if D
OTNET5_2
Console
.
WriteLine
(
"CoreCLR"
);
#else
Console
.
WriteLine
(
".NET: "
+
Environment
.
Version
);
...
...
@@ -105,7 +105,7 @@ static void Main()
RunPerformanceTests
();
#endif
#if D
NXCORE50
#if D
OTNET5_2
Console
.
WriteLine
(
"(end of tests; press return)"
);
Console
.
ReadLine
();
#else
...
...
@@ -164,7 +164,7 @@ insert Posts ([Text],CreationDate, LastChangeDate) values (replicate('x', 2000),
}
private
static
bool
HasAttribute
<
T
>(
MemberInfo
member
)
where
T
:
Attribute
{
#if D
NXCORE50
#if D
OTNET5_2
return
member
.
CustomAttributes
.
Any
(
x
=>
x
.
AttributeType
==
typeof
(
T
));
#else
return
Attribute
.
IsDefined
(
member
,
typeof
(
T
),
true
);
...
...
Dapper.DNX.Tests/Tests.Async.cs
View file @
05cd5344
...
...
@@ -9,7 +9,7 @@
using
System.Threading
;
using
System.Data.SqlClient
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
...
...
Dapper.DNX.Tests/Tests.cs
View file @
05cd5344
//#define POSTGRESQL // uncomment to run postgres tests
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
...
...
@@ -34,7 +34,7 @@
#endif
#endif
#if D
NXCORE50
#if D
OTNET5_2
namespace
System.ComponentModel
{
public
sealed
class
DescriptionAttribute
:
Attribute
{
public
DescriptionAttribute
(
string
description
)
...
...
@@ -2570,7 +2570,7 @@ public void TestCustomTypeMap()
static
string
GetDescriptionFromAttribute
(
MemberInfo
member
)
{
if
(
member
==
null
)
return
null
;
#if D
NXCORE50
#if D
OTNET5_2
var
data
=
member
.
CustomAttributes
.
FirstOrDefault
(
x
=>
x
.
AttributeType
==
typeof
(
DescriptionAttribute
));
return
(
string
)
data
?.
ConstructorArguments
.
Single
().
Value
;
#else
...
...
@@ -2944,7 +2944,7 @@ public void TestChangingDefaultStringTypeMappingToAnsiString()
Dapper
.
SqlMapper
.
PurgeQueryCache
();
Dapper
.
SqlMapper
.
AddTypeMap
(
typeof
(
string
),
DbType
.
String
);
// Restore Default to Unicode String
}
#if D
NXCORE50
#if D
OTNET5_2
class
TransactedConnection
:
IDbConnection
{
IDbConnection
_conn
;
...
...
@@ -3131,7 +3131,7 @@ public void TestDoubleDecimalConversions_SO18228523_Nulls()
}
private
static
CultureInfo
ActiveCulture
{
#if D
NXCORE50
#if D
OTNET5_2
get
{
return
CultureInfo
.
CurrentCulture
;
}
set
{
CultureInfo
.
CurrentCulture
=
value
;
}
#else
...
...
@@ -3189,7 +3189,7 @@ enum AnotherEnum : byte
B
=
1
}
#if D
NXCORE50
#if D
OTNET5_2
[
FrameworkFail
(
"https://github.com/dotnet/corefx/issues/1613"
)]
#endif
public
void
AdoNetEnumValue
()
...
...
@@ -3608,7 +3608,7 @@ public class SomeType
public
int
A
{
get
;
set
;
}
public
string
B
{
get
;
set
;
}
}
#if !D
NXCORE50
#if !D
OTNET5_2
class
WithInit
:
ISupportInitialize
{
public
string
Value
{
get
;
set
;
}
...
...
@@ -4441,7 +4441,7 @@ public void SO29343103_UtcDates()
var
delta
=
returned
-
date
;
Assert
.
IsTrue
(
delta
.
TotalMilliseconds
>=
-
1
&&
delta
.
TotalMilliseconds
<=
1
);
}
#if D
NXCORE50
#if D
OTNET5_2
[
FrameworkFail
(
"https://github.com/dotnet/corefx/issues/1612"
)]
#endif
public
void
Issue261_Decimals
()
...
...
@@ -4453,7 +4453,7 @@ public void Issue261_Decimals()
var
c
=
parameters
.
Get
<
Decimal
>(
"c"
);
c
.
IsEqualTo
(
11.884
M
);
}
#if D
NXCORE50
#if D
OTNET5_2
[
FrameworkFail
(
"https://github.com/dotnet/corefx/issues/1612"
)]
#endif
public
void
Issue261_Decimals_ADONET_SetViaBaseClass
()
...
...
Dapper.DNX.Tests/project.json
View file @
05cd5344
...
...
@@ -33,18 +33,7 @@
"System.Xml"
:
"4.0.0.0"
}
},
"dnx451"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
],
"shouldDefine"
:
[
],
"warningsAsErrors"
:
true
},
"frameworkAssemblies"
:
{
"System.Data"
:
"4.0.0.0"
,
"System.Xml"
:
"4.0.0.0"
}
},
"dnxcore50"
:
{
"dotnet5.2"
:
{
"compilationOptions"
:
{
"define"
:
[
],
"shouldDefine"
:
[
"ASYNC"
]
...
...
Dapper.StrongName/project.json
View file @
05cd5344
...
...
@@ -33,16 +33,7 @@
"System.Data"
:
"4.0.0.0"
}
},
"dnx451"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
],
"warningsAsErrors"
:
true
},
"frameworkAssemblies"
:
{
"System.Data"
:
"4.0.0.0"
}
},
"dnxcore50"
:
{
"dotnet5.2"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
],
"warningsAsErrors"
:
true
...
...
Dapper/CommandDefinition.cs
View file @
05cd5344
...
...
@@ -4,7 +4,7 @@
using
System.Reflection.Emit
;
using
System.Threading
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
...
...
Dapper/DataTableHandler.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if !D
NXCORE50
#if !D
OTNET5_2
namespace
Dapper
{
sealed
class
DataTableHandler
:
SqlMapper
.
ITypeHandler
...
...
Dapper/DbString.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
...
...
Dapper/DefaultTypeMap.cs
View file @
05cd5344
...
...
@@ -26,7 +26,7 @@ public DefaultTypeMap(Type type)
Properties
=
GetSettableProps
(
type
);
_type
=
type
;
}
#if D
NXCORE50
#if D
OTNET5_2
static
bool
IsParameterMatch
(
ParameterInfo
[]
x
,
ParameterInfo
[]
y
)
{
if
(
ReferenceEquals
(
x
,
y
))
return
true
;
...
...
@@ -40,7 +40,7 @@ static bool IsParameterMatch(ParameterInfo[] x, ParameterInfo[] y)
internal
static
MethodInfo
GetPropertySetter
(
PropertyInfo
propertyInfo
,
Type
type
)
{
if
(
propertyInfo
.
DeclaringType
==
type
)
return
propertyInfo
.
GetSetMethod
(
true
);
#if D
NXCORE50
#if D
OTNET5_2
return
propertyInfo
.
DeclaringType
.
GetProperties
(
BindingFlags
.
Public
|
BindingFlags
.
NonPublic
|
BindingFlags
.
Instance
)
.
Single
(
x
=>
x
.
Name
==
propertyInfo
.
Name
&&
x
.
PropertyType
==
propertyInfo
.
PropertyType
...
...
@@ -118,7 +118,7 @@ public ConstructorInfo FindConstructor(string[] names, Type[] types)
public
ConstructorInfo
FindExplicitConstructor
()
{
var
constructors
=
_type
.
GetConstructors
(
BindingFlags
.
Instance
|
BindingFlags
.
Public
|
BindingFlags
.
NonPublic
);
#if D
NXCORE50
#if D
OTNET5_2
var
withAttr
=
constructors
.
Where
(
c
=>
c
.
CustomAttributes
.
Any
(
x
=>
x
.
AttributeType
==
typeof
(
ExplicitConstructorAttribute
))).
ToList
();
#else
var
withAttr
=
constructors
.
Where
(
c
=>
c
.
GetCustomAttributes
(
typeof
(
ExplicitConstructorAttribute
),
true
).
Length
>
0
).
ToList
();
...
...
Dapper/DynamicParameters.CachedOutputSetters.cs
View file @
05cd5344
...
...
@@ -8,7 +8,7 @@ partial class DynamicParameters
{
internal
static
class
CachedOutputSetters
<
T
>
{
#if D
NXCORE50
#if D
OTNET5_2
public
static
readonly
Dictionary
<
string
,
Action
<
object
,
DynamicParameters
>>
Cache
=
new
Dictionary
<
string
,
Action
<
object
,
DynamicParameters
>>();
#else
public
static
readonly
Hashtable
Cache
=
new
Hashtable
();
...
...
Dapper/DynamicParameters.ParamInfo.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
...
...
Dapper/DynamicParameters.cs
View file @
05cd5344
...
...
@@ -6,7 +6,7 @@
using
System.Reflection
;
using
System.Reflection.Emit
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
ApplicationException
=
System
.
InvalidOperationException
;
...
...
@@ -401,7 +401,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
var
cache
=
CachedOutputSetters
<
T
>.
Cache
;
Action
<
object
,
DynamicParameters
>
setter
;
#if D
NXCORE50
#if D
OTNET5_2
lock
(
cache
)
{
if
(!
cache
.
TryGetValue
(
lookup
,
out
setter
))
setter
=
null
;
...
...
Dapper/FeatureSupport.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
namespace
Dapper
...
...
Dapper/SqlDataRecordHandler.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Data
;
#if !D
NXCORE50
#if !D
OTNET5_2
namespace
Dapper
{
sealed
class
SqlDataRecordHandler
:
SqlMapper
.
ITypeHandler
...
...
Dapper/SqlDataRecordListTVPParameter.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
System.Data
;
using
System.Reflection
;
#if !D
NXCORE50
#if !D
OTNET5_2
namespace
Dapper
{
...
...
Dapper/SqlMapper.Async.cs
View file @
05cd5344
...
...
@@ -9,7 +9,7 @@
using
System.Threading
;
using
System.Threading.Tasks
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
...
...
Dapper/SqlMapper.CacheInfo.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.Data
;
using
System.Threading
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
...
...
Dapper/SqlMapper.DeserializerState.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
...
...
Dapper/SqlMapper.GridReader.Async.cs
View file @
05cd5344
...
...
@@ -6,7 +6,7 @@
using
System.Linq
;
using
System.Threading
;
using
System.Threading.Tasks
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
...
...
Dapper/SqlMapper.GridReader.cs
View file @
05cd5344
...
...
@@ -3,7 +3,7 @@
using
System.Data
;
using
System.Linq
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
...
...
Dapper/SqlMapper.ICustomQueryParameter.cs
View file @
05cd5344
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
namespace
Dapper
...
...
Dapper/SqlMapper.IDynamicParameters.cs
View file @
05cd5344
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
#endif
...
...
Dapper/SqlMapper.ITypeHandler.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
namespace
Dapper
...
...
Dapper/SqlMapper.Identity.cs
View file @
05cd5344
using
System
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbConnection
=
System
.
Data
.
Common
.
DbConnection
;
#endif
...
...
Dapper/SqlMapper.TypeHandler.cs
View file @
05cd5344
...
...
@@ -4,7 +4,7 @@
using
System.Linq
;
using
System.Text
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
...
...
Dapper/SqlMapper.TypeHandlerCache.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.ComponentModel
;
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
#endif
...
...
@@ -14,7 +14,7 @@ partial class SqlMapper
/// Not intended for direct usage
/// </summary>
[
Obsolete
(
"Not intended for direct usage"
,
false
)]
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
Dapper/SqlMapper.cs
View file @
05cd5344
...
...
@@ -3,7 +3,7 @@
Home page: http://code.google.com/p/dapper-dot-net/
*/
#if D
NXCORE50
#if D
OTNET5_2
using
IDbDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDataParameter
=
System
.
Data
.
Common
.
DbParameter
;
using
IDbTransaction
=
System
.
Data
.
Common
.
DbTransaction
;
...
...
@@ -214,7 +214,7 @@ static SqlMapper()
[
typeof
(
TimeSpan
?)]
=
DbType
.
Time
,
[
typeof
(
object
)]
=
DbType
.
Object
};
#if !D
NXCORE50
#if !D
OTNET5_2
AddTypeHandlerImpl
(
typeof
(
DataTable
),
new
DataTableHandler
(),
false
);
AddTypeHandlerImpl
(
typeof
(
IEnumerable
<
Microsoft
.
SqlServer
.
Server
.
SqlDataRecord
>),
new
SqlDataRecordHandler
(),
false
);
#endif
...
...
@@ -226,7 +226,7 @@ static SqlMapper()
public
static
void
ResetTypeHandlers
()
{
typeHandlers
=
new
Dictionary
<
Type
,
ITypeHandler
>();
#if !D
NXCORE50
#if !D
OTNET5_2
AddTypeHandlerImpl
(
typeof
(
DataTable
),
new
DataTableHandler
(),
true
);
AddTypeHandlerImpl
(
typeof
(
IEnumerable
<
Microsoft
.
SqlServer
.
Server
.
SqlDataRecord
>),
new
SqlDataRecordHandler
(),
true
);
#endif
...
...
@@ -321,7 +321,7 @@ public static void AddTypeHandler<T>(TypeHandler<T> handler)
/// Get the DbType that maps to a given value
/// </summary>
[
Obsolete
(
"This method is for internal use only"
)]
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
@@ -360,7 +360,7 @@ internal static DbType LookupDbType(Type type, string name, bool demand, out ITy
return
DynamicParameters
.
EnumerableMultiParameter
;
}
#if !D
NXCORE50
#if !D
OTNET5_2
switch
(
type
.
FullName
)
{
case
"Microsoft.SqlServer.Types.SqlGeography"
:
...
...
@@ -1401,7 +1401,7 @@ private static Exception MultiMapException(IDataRecord reader)
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
@@ -1417,7 +1417,7 @@ public static char ReadChar(object value)
/// <summary>
/// Internal use only
/// </summary>
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
@@ -1434,7 +1434,7 @@ public static char ReadChar(object value)
/// <summary>
/// Internal use only
/// </summary>
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
@@ -1458,7 +1458,7 @@ public static IDbDataParameter FindOrAddParameter(IDataParameterCollection param
/// <summary>
/// Internal use only
/// </summary>
#if !D
NXCORE50
#if !D
OTNET5_2
[
Browsable
(
false
)]
#endif
[
EditorBrowsable
(
EditorBrowsableState
.
Never
)]
...
...
@@ -1637,7 +1637,7 @@ public static string Format(object value)
{
switch
(
TypeExtensions
.
GetTypeCode
(
value
.
GetType
()))
{
#if !D
NXCORE50
#if !D
OTNET5_2
case
TypeCode
.
DBNull
:
return
"null"
;
#endif
...
...
@@ -2282,7 +2282,7 @@ static readonly MethodInfo
public
static
ITypeMap
GetTypeMap
(
Type
type
)
{
if
(
type
==
null
)
throw
new
ArgumentNullException
(
nameof
(
type
));
#if D
NXCORE50
#if D
OTNET5_2
ITypeMap
map
=
null
;
#else
var
map
=
(
ITypeMap
)
_typeMaps
[
type
];
...
...
@@ -2292,7 +2292,7 @@ public static ITypeMap GetTypeMap(Type type)
lock
(
_typeMaps
)
{
// double-checked; store this to avoid reflection next time we see this type
// since multiple queries commonly use the same domain-entity/DTO/view-model type
#if D
NXCORE50
#if D
OTNET5_2
if
(!
_typeMaps
.
TryGetValue
(
type
,
out
map
))
map
=
null
;
#else
map
=
(
ITypeMap
)
_typeMaps
[
type
];
...
...
@@ -2309,7 +2309,7 @@ public static ITypeMap GetTypeMap(Type type)
}
// use Hashtable to get free lockless reading
#if D
NXCORE50
#if D
OTNET5_2
private
static
readonly
Dictionary
<
Type
,
ITypeMap
>
_typeMaps
=
new
Dictionary
<
Type
,
ITypeMap
>();
#else
private
static
readonly
Hashtable
_typeMaps
=
new
Hashtable
();
...
...
@@ -2382,7 +2382,7 @@ public static void SetTypeMap(Type type, ITypeMap map)
ConstructorInfo
specializedConstructor
=
null
;
#if !D
NXCORE50
#if !D
OTNET5_2
bool
supportInitialize
=
false
;
#endif
if
(
type
.
IsValueType
())
...
...
@@ -2427,7 +2427,7 @@ public static void SetTypeMap(Type type, ITypeMap map)
il
.
Emit
(
OpCodes
.
Newobj
,
explicitConstr
);
il
.
Emit
(
OpCodes
.
Stloc_1
);
#if !D
NXCORE50
#if !D
OTNET5_2
supportInitialize
=
typeof
(
ISupportInitialize
).
IsAssignableFrom
(
type
);
if
(
supportInitialize
)
{
...
...
@@ -2449,7 +2449,7 @@ public static void SetTypeMap(Type type, ITypeMap map)
{
il
.
Emit
(
OpCodes
.
Newobj
,
ctor
);
il
.
Emit
(
OpCodes
.
Stloc_1
);
#if !D
NXCORE50
#if !D
OTNET5_2
supportInitialize
=
typeof
(
ISupportInitialize
).
IsAssignableFrom
(
type
);
if
(
supportInitialize
)
{
...
...
@@ -2643,7 +2643,7 @@ public static void SetTypeMap(Type type, ITypeMap map)
il
.
Emit
(
OpCodes
.
Newobj
,
specializedConstructor
);
}
il
.
Emit
(
OpCodes
.
Stloc_1
);
// stack is empty
#if !D
NXCORE50
#if !D
OTNET5_2
if
(
supportInitialize
)
{
il
.
Emit
(
OpCodes
.
Ldloc_1
);
...
...
@@ -2914,7 +2914,7 @@ public static IEqualityComparer<string> ConnectionStringComparer
#if !D
NXCORE50
#if !D
OTNET5_2
/// <summary>
/// Used to pass a DataTable as a TableValuedParameter
/// </summary>
...
...
Dapper/TableValuedParameter.cs
View file @
05cd5344
...
...
@@ -2,7 +2,7 @@
using
System.Data
;
using
System.Reflection
;
#if !D
NXCORE50
#if !D
OTNET5_2
namespace
Dapper
{
/// <summary>
...
...
Dapper/TypeExtensions.cs
View file @
05cd5344
...
...
@@ -8,7 +8,7 @@ internal static class TypeExtensions
{
public
static
bool
IsValueType
(
this
Type
type
)
{
#if D
NXCORE50
#if D
OTNET5_2
return
type
.
GetTypeInfo
().
IsValueType
;
#else
return
type
.
IsValueType
;
...
...
@@ -16,13 +16,13 @@ public static bool IsValueType(this Type type)
}
public
static
bool
IsEnum
(
this
Type
type
)
{
#if D
NXCORE50
#if D
OTNET5_2
return
type
.
GetTypeInfo
().
IsEnum
;
#else
return
type
.
IsEnum
;
#endif
}
#if D
NXCORE50
#if D
OTNET5_2
public
static
TypeCode
GetTypeCode
(
Type
type
)
{
if
(
type
==
null
)
return
TypeCode
.
Empty
;
...
...
@@ -63,7 +63,7 @@ public static TypeCode GetTypeCode(Type type)
#endif
public
static
MethodInfo
GetPublicInstanceMethod
(
this
Type
type
,
string
name
,
Type
[]
types
)
{
#if D
NXCORE50
#if D
OTNET5_2
var
method
=
type
.
GetMethod
(
name
,
types
);
return
(
method
!=
null
&&
method
.
IsPublic
&&
!
method
.
IsStatic
)
?
method
:
null
;
#else
...
...
Dapper/UdtTypeHandler.cs
View file @
05cd5344
...
...
@@ -5,7 +5,7 @@ namespace Dapper
{
partial
class
SqlMapper
{
#if !D
NXCORE50
#if !D
OTNET5_2
/// <summary>
/// A type handler for data-types that are supported by the underlying provider, but which need
/// a well-known UdtTypeName to be specified
...
...
Dapper/WrappedDataReader.cs
View file @
05cd5344
using
System.Data
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
{
#if D
NXCORE50
#if D
OTNET5_2
/// <summary>
/// Describes a reader that controls the lifetime of both a command and a reader,
/// exposing the downstream command/reader as properties.
...
...
Dapper/WrappedReader.cs
View file @
05cd5344
...
...
@@ -2,14 +2,14 @@
using
System.Data
;
using
System.Collections
;
#if D
NXCORE50
#if D
OTNET5_2
using
IDbCommand
=
System
.
Data
.
Common
.
DbCommand
;
using
IDataReader
=
System
.
Data
.
Common
.
DbDataReader
;
#endif
namespace
Dapper
{
#if D
NXCORE50
#if D
OTNET5_2
internal
class
WrappedReader
:
WrappedDataReader
{
private
IDbCommand
cmd
;
...
...
Dapper/project.json
View file @
05cd5344
...
...
@@ -29,17 +29,7 @@
"System.Xml"
:
"4.0.0.0"
}
},
"dnx451"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
],
"warningsAsErrors"
:
true
},
"frameworkAssemblies"
:
{
"System.Data"
:
"4.0.0.0"
,
"System.Xml"
:
"4.0.0.0"
}
},
"dnxcore50"
:
{
"dotnet5.2"
:
{
"compilationOptions"
:
{
"define"
:
[
"ASYNC"
],
"warningsAsErrors"
:
true
...
...
global.json
View file @
05cd5344
{
"sdk"
:
{
"version"
:
"1.0.0-
beta8
"
"version"
:
"1.0.0-
rc1-final
"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment