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
69d5be37
Commit
69d5be37
authored
Jan 06, 2012
by
Sam Saffron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inheritance was wonky, internal props on inherited stuff could not be set
parent
38b3f224
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
SqlMapper.cs
Dapper/SqlMapper.cs
+3
-1
Tests.cs
Tests/Tests.cs
+29
-0
No files found.
Dapper/SqlMapper.cs
View file @
69d5be37
...
...
@@ -1428,7 +1428,9 @@ static List<PropInfo> GetSettableProps(Type t)
.
Select
(
p
=>
new
PropInfo
{
Name
=
p
.
Name
,
Setter
=
p
.
DeclaringType
==
t
?
p
.
GetSetMethod
(
true
)
:
p
.
DeclaringType
.
GetProperty
(
p
.
Name
).
GetSetMethod
(
true
),
Setter
=
p
.
DeclaringType
==
t
?
p
.
GetSetMethod
(
true
)
:
p
.
DeclaringType
.
GetProperty
(
p
.
Name
,
BindingFlags
.
Public
|
BindingFlags
.
NonPublic
|
BindingFlags
.
Instance
).
GetSetMethod
(
true
),
Type
=
p
.
PropertyType
})
.
Where
(
info
=>
info
.
Setter
!=
null
)
...
...
Tests/Tests.cs
View file @
69d5be37
...
...
@@ -16,6 +16,35 @@ class Tests
{
SqlConnection
connection
=
Program
.
GetOpenConnection
();
public
class
AbstractInheritance
{
public
abstract
class
Order
{
internal
int
Internal
{
get
;
set
;
}
protected
int
Protected
{
get
;
set
;
}
public
int
Public
{
get
;
set
;
}
public
int
ProtectedVal
{
get
{
return
Protected
;
}
}
}
public
class
ConcreteOrder
:
Order
{
public
int
Concrete
{
get
;
set
;
}
}
}
// http://stackoverflow.com/q/8593871
public
void
TestAbstractInheritance
()
{
var
order
=
connection
.
Query
<
AbstractInheritance
.
ConcreteOrder
>(
"select 1 Internal,2 Protected,3 [Public],4 Concrete"
).
First
();
order
.
Internal
.
IsEqualTo
(
1
);
order
.
ProtectedVal
.
IsEqualTo
(
2
);
order
.
Public
.
IsEqualTo
(
3
);
order
.
Concrete
.
IsEqualTo
(
4
);
}
public
void
TestListOfAnsiStrings
()
{
...
...
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