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
67d0ac67
Commit
67d0ac67
authored
Nov 05, 2011
by
mgravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove System.Data.Linq ref
parent
f333c2f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
Dapper NET35.csproj
Dapper NET35/Dapper NET35.csproj
+0
-1
Dapper.csproj
Dapper/Dapper.csproj
+0
-1
SqlMapper.cs
Dapper/SqlMapper.cs
+12
-8
No files found.
Dapper NET35/Dapper NET35.csproj
View file @
67d0ac67
...
...
@@ -36,7 +36,6 @@
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Data.Linq"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\Dapper\Properties\AssemblyInfo.cs"
>
...
...
Dapper/Dapper.csproj
View file @
67d0ac67
...
...
@@ -38,7 +38,6 @@
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Data.Linq"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"SqlMapper.cs"
/>
...
...
Dapper/SqlMapper.cs
View file @
67d0ac67
...
...
@@ -294,9 +294,9 @@ static SqlMapper()
typeMap
[
typeof
(
Guid
?)]
=
DbType
.
Guid
;
typeMap
[
typeof
(
DateTime
?)]
=
DbType
.
DateTime
;
typeMap
[
typeof
(
DateTimeOffset
?)]
=
DbType
.
DateTimeOffset
;
typeMap
[
typeof
(
System
.
Data
.
Linq
.
Binary
)]
=
DbType
.
Binary
;
}
private
const
string
LinqBinary
=
"System.Data.Linq.Binary"
;
private
static
DbType
LookupDbType
(
Type
type
,
string
name
)
{
DbType
dbType
;
...
...
@@ -310,6 +310,10 @@ private static DbType LookupDbType(Type type, string name)
{
return
dbType
;
}
if
(
type
.
FullName
==
LinqBinary
)
{
return
DbType
.
Binary
;
}
if
(
typeof
(
IEnumerable
).
IsAssignableFrom
(
type
))
{
// use xml to denote its a list, hacky but will work on any DB
...
...
@@ -926,7 +930,7 @@ private static CacheInfo GetCacheInfo(Identity identity)
}
#endif
if
(!
typeMap
.
ContainsKey
(
type
))
if
(!
(
typeMap
.
ContainsKey
(
type
)
||
type
.
FullName
==
LinqBinary
))
{
return
GetTypeDeserializer
(
type
,
reader
,
startBound
,
length
,
returnNullIfFirstMissing
);
}
...
...
@@ -1314,9 +1318,9 @@ private static IEnumerable<PropertyInfo> FilterParameters(IEnumerable<PropertyIn
il
.
MarkLabel
(
lenDone
);
il
.
Emit
(
OpCodes
.
Stloc_1
);
// [string]
}
if
(
prop
.
PropertyType
==
typeof
(
System
.
Data
.
Linq
.
Binary
)
)
if
(
prop
.
PropertyType
.
FullName
==
LinqBinary
)
{
il
.
EmitCall
(
OpCodes
.
Callvirt
,
typeof
(
System
.
Data
.
Linq
.
Binary
)
.
GetMethod
(
"ToArray"
,
BindingFlags
.
Public
|
BindingFlags
.
Instance
),
null
);
il
.
EmitCall
(
OpCodes
.
Callvirt
,
prop
.
PropertyType
.
GetMethod
(
"ToArray"
,
BindingFlags
.
Public
|
BindingFlags
.
Instance
),
null
);
}
if
(
allDone
!=
null
)
il
.
MarkLabel
(
allDone
.
Value
);
// relative stack [boxed value or DBNull]
...
...
@@ -1385,9 +1389,9 @@ private static int ExecuteCommand(IDbConnection cnn, IDbTransaction transaction,
{
return
r
=>
SqlMapper
.
ReadNullableChar
(
r
.
GetValue
(
index
));
}
if
(
type
==
typeof
(
System
.
Data
.
Linq
.
Binary
)
)
if
(
type
.
FullName
==
LinqBinary
)
{
return
r
=>
new
System
.
Data
.
Linq
.
Binary
((
byte
[])
r
.
GetValue
(
index
));
return
r
=>
Activator
.
CreateInstance
(
type
,
r
.
GetValue
(
index
));
}
#pragma warning restore 618
return
r
=>
...
...
@@ -1582,10 +1586,10 @@ static List<FieldInfo> GetSettableFields(Type t)
il
.
MarkLabel
(
isNotString
);
}
if
(
memberType
==
typeof
(
System
.
Data
.
Linq
.
Binary
)
)
if
(
memberType
.
FullName
==
LinqBinary
)
{
il
.
Emit
(
OpCodes
.
Unbox_Any
,
typeof
(
byte
[]));
// stack is now [target][target][byte-array]
il
.
Emit
(
OpCodes
.
Newobj
,
typeof
(
System
.
Data
.
Linq
.
Binary
)
.
GetConstructor
(
new
Type
[]
{
typeof
(
byte
[])
}));
// stack is now [target][target][binary]
il
.
Emit
(
OpCodes
.
Newobj
,
memberType
.
GetConstructor
(
new
Type
[]
{
typeof
(
byte
[])
}));
// stack is now [target][target][binary]
}
else
{
...
...
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