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
d9306233
Commit
d9306233
authored
Nov 23, 2011
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
concurrency fix, in case we allow for deleting of caches
parent
33959b3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
SqlMapperExtensions.cs
Dapper.Contrib/SqlMapperExtensions.cs
+10
-6
No files found.
Dapper.Contrib/SqlMapperExtensions.cs
View file @
d9306233
...
@@ -27,9 +27,11 @@ public interface IProxy
...
@@ -27,9 +27,11 @@ public interface IProxy
private
static
IEnumerable
<
PropertyInfo
>
KeyPropertiesCache
(
Type
type
)
private
static
IEnumerable
<
PropertyInfo
>
KeyPropertiesCache
(
Type
type
)
{
{
if
(
KeyProperties
.
ContainsKey
(
type
.
TypeHandle
))
IEnumerable
<
PropertyInfo
>
pi
;
if
(
KeyProperties
.
TryGetValue
(
type
.
TypeHandle
,
out
pi
))
{
{
return
KeyProperties
[
type
.
TypeHandle
]
;
return
pi
;
}
}
var
allProperties
=
TypePropertiesCache
(
type
);
var
allProperties
=
TypePropertiesCache
(
type
);
...
@@ -49,9 +51,10 @@ private static IEnumerable<PropertyInfo> KeyPropertiesCache(Type type)
...
@@ -49,9 +51,10 @@ private static IEnumerable<PropertyInfo> KeyPropertiesCache(Type type)
}
}
private
static
IEnumerable
<
PropertyInfo
>
TypePropertiesCache
(
Type
type
)
private
static
IEnumerable
<
PropertyInfo
>
TypePropertiesCache
(
Type
type
)
{
{
if
(
TypeProperties
.
ContainsKey
(
type
.
TypeHandle
))
IEnumerable
<
PropertyInfo
>
pis
;
if
(
TypeProperties
.
TryGetValue
(
type
.
TypeHandle
,
out
pis
))
{
{
return
TypeProperties
[
type
.
TypeHandle
]
;
return
pis
;
}
}
var
properties
=
type
.
GetProperties
();
var
properties
=
type
.
GetProperties
();
...
@@ -286,9 +289,10 @@ public static T GetInterfaceProxy<T>()
...
@@ -286,9 +289,10 @@ public static T GetInterfaceProxy<T>()
{
{
Type
typeOfT
=
typeof
(
T
);
Type
typeOfT
=
typeof
(
T
);
if
(
TypeCache
.
ContainsKey
(
typeOfT
))
object
k
;
if
(
TypeCache
.
TryGetValue
(
typeOfT
,
out
k
))
{
{
return
(
T
)
TypeCache
[
typeOfT
]
;
return
(
T
)
k
;
}
}
var
assemblyBuilder
=
GetAsmBuilder
(
typeOfT
.
Name
);
var
assemblyBuilder
=
GetAsmBuilder
(
typeOfT
.
Name
);
...
...
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