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
c75df1e3
Commit
c75df1e3
authored
Nov 22, 2015
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hashtable was simply hiding; reinstate throughout
parent
9ae3d50b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
28 deletions
+6
-28
project.json
Dapper.StrongName/project.json
+2
-1
DynamicParameters.CachedOutputSetters.cs
Dapper/DynamicParameters.CachedOutputSetters.cs
+0
-4
DynamicParameters.cs
Dapper/DynamicParameters.cs
+1
-9
SqlMapper.cs
Dapper/SqlMapper.cs
+1
-13
project.json
Dapper/project.json
+2
-1
No files found.
Dapper.StrongName/project.json
View file @
c75df1e3
...
@@ -58,7 +58,8 @@
...
@@ -58,7 +58,8 @@
"System.Reflection.TypeExtensions"
:
"4.1.0-*"
,
"System.Reflection.TypeExtensions"
:
"4.1.0-*"
,
"System.Text.RegularExpressions"
:
"4.0.11-*"
,
"System.Text.RegularExpressions"
:
"4.0.11-*"
,
"System.Threading"
:
"4.0.11-*"
,
"System.Threading"
:
"4.0.11-*"
,
"System.Threading.ThreadPool"
:
"4.0.10-*"
"System.Threading.ThreadPool"
:
"4.0.10-*"
,
"System.Collections.NonGeneric"
:
"4.0.1-*"
}
}
}
}
}
}
...
...
Dapper/DynamicParameters.CachedOutputSetters.cs
View file @
c75df1e3
...
@@ -8,11 +8,7 @@ partial class DynamicParameters
...
@@ -8,11 +8,7 @@ partial class DynamicParameters
{
{
internal
static
class
CachedOutputSetters
<
T
>
internal
static
class
CachedOutputSetters
<
T
>
{
{
#if COREFX
public
static
readonly
Dictionary
<
string
,
Action
<
object
,
DynamicParameters
>>
Cache
=
new
Dictionary
<
string
,
Action
<
object
,
DynamicParameters
>>();
#else
public
static
readonly
Hashtable
Cache
=
new
Hashtable
();
public
static
readonly
Hashtable
Cache
=
new
Hashtable
();
#endif
}
}
}
}
}
}
Dapper/DynamicParameters.cs
View file @
c75df1e3
...
@@ -400,15 +400,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
...
@@ -400,15 +400,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
var
lookup
=
string
.
Join
(
"|"
,
names
.
ToArray
());
var
lookup
=
string
.
Join
(
"|"
,
names
.
ToArray
());
var
cache
=
CachedOutputSetters
<
T
>.
Cache
;
var
cache
=
CachedOutputSetters
<
T
>.
Cache
;
Action
<
object
,
DynamicParameters
>
setter
;
Action
<
object
,
DynamicParameters
>
setter
=
(
Action
<
object
,
DynamicParameters
>)
cache
[
lookup
];
#if COREFX
lock
(
cache
)
{
if
(!
cache
.
TryGetValue
(
lookup
,
out
setter
))
setter
=
null
;
}
#else
setter
=
(
Action
<
object
,
DynamicParameters
>)
cache
[
lookup
];
#endif
if
(
setter
!=
null
)
goto
MAKECALLBACK
;
if
(
setter
!=
null
)
goto
MAKECALLBACK
;
// Come on let's build a method, let's build it, let's build it now!
// Come on let's build a method, let's build it, let's build it now!
...
...
Dapper/SqlMapper.cs
View file @
c75df1e3
...
@@ -2282,23 +2282,15 @@ static readonly MethodInfo
...
@@ -2282,23 +2282,15 @@ static readonly MethodInfo
public
static
ITypeMap
GetTypeMap
(
Type
type
)
public
static
ITypeMap
GetTypeMap
(
Type
type
)
{
{
if
(
type
==
null
)
throw
new
ArgumentNullException
(
nameof
(
type
));
if
(
type
==
null
)
throw
new
ArgumentNullException
(
nameof
(
type
));
#if COREFX
ITypeMap
map
=
null
;
#else
var
map
=
(
ITypeMap
)
_typeMaps
[
type
];
var
map
=
(
ITypeMap
)
_typeMaps
[
type
];
#endif
if
(
map
==
null
)
if
(
map
==
null
)
{
{
lock
(
_typeMaps
)
lock
(
_typeMaps
)
{
// double-checked; store this to avoid reflection next time we see this type
{
// 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
// since multiple queries commonly use the same domain-entity/DTO/view-model type
#if COREFX
if
(!
_typeMaps
.
TryGetValue
(
type
,
out
map
))
map
=
null
;
#else
map
=
(
ITypeMap
)
_typeMaps
[
type
];
map
=
(
ITypeMap
)
_typeMaps
[
type
];
#endif
if
(
map
==
null
)
if
(
map
==
null
)
{
{
map
=
TypeMapProvider
(
type
);
map
=
TypeMapProvider
(
type
);
_typeMaps
[
type
]
=
map
;
_typeMaps
[
type
]
=
map
;
...
@@ -2309,11 +2301,7 @@ public static ITypeMap GetTypeMap(Type type)
...
@@ -2309,11 +2301,7 @@ public static ITypeMap GetTypeMap(Type type)
}
}
// use Hashtable to get free lockless reading
// use Hashtable to get free lockless reading
#if COREFX
private
static
readonly
Dictionary
<
Type
,
ITypeMap
>
_typeMaps
=
new
Dictionary
<
Type
,
ITypeMap
>();
#else
private
static
readonly
Hashtable
_typeMaps
=
new
Hashtable
();
private
static
readonly
Hashtable
_typeMaps
=
new
Hashtable
();
#endif
/// <summary>
/// <summary>
/// Set custom mapping for type deserializers
/// Set custom mapping for type deserializers
...
...
Dapper/project.json
View file @
c75df1e3
...
@@ -56,7 +56,8 @@
...
@@ -56,7 +56,8 @@
"System.Reflection.TypeExtensions"
:
"4.1.0-*"
,
"System.Reflection.TypeExtensions"
:
"4.1.0-*"
,
"System.Text.RegularExpressions"
:
"4.0.11-*"
,
"System.Text.RegularExpressions"
:
"4.0.11-*"
,
"System.Threading"
:
"4.0.11-*"
,
"System.Threading"
:
"4.0.11-*"
,
"System.Threading.ThreadPool"
:
"4.0.10-*"
"System.Threading.ThreadPool"
:
"4.0.10-*"
,
"System.Collections.NonGeneric"
:
"4.0.1-*"
}
}
}
}
}
}
...
...
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