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
b77e5384
Commit
b77e5384
authored
Sep 06, 2015
by
Johan Danforth
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #335 from ithero7/master
Little changes :)
parents
010eae66
bbf93cb2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
SqlMapperExtensions.cs
Dapper.Contrib/SqlMapperExtensions.cs
+4
-4
No files found.
Dapper.Contrib/SqlMapperExtensions.cs
View file @
b77e5384
...
@@ -126,7 +126,7 @@ private static bool IsWriteable(PropertyInfo pi)
...
@@ -126,7 +126,7 @@ private static bool IsWriteable(PropertyInfo pi)
if
(
keys
.
Count
()
>
1
)
if
(
keys
.
Count
()
>
1
)
throw
new
DataException
(
"Get<T> only supports an entity with a single [Key] property"
);
throw
new
DataException
(
"Get<T> only supports an entity with a single [Key] property"
);
if
(!
keys
.
Any
())
if
(!
keys
.
Any
())
throw
new
DataException
(
"Get<T> only supports
e
n entity with a [Key] property"
);
throw
new
DataException
(
"Get<T> only supports
a
n entity with a [Key] property"
);
var
onlyKey
=
keys
.
First
();
var
onlyKey
=
keys
.
First
();
...
@@ -232,9 +232,9 @@ private static string GetTableName(Type type)
...
@@ -232,9 +232,9 @@ private static string GetTableName(Type type)
else
else
{
{
//NOTE: This as dynamic trick should be able to handle both our own Table-attribute as well as the one in EntityFramework
//NOTE: This as dynamic trick should be able to handle both our own Table-attribute as well as the one in EntityFramework
var
table
a
ttr
=
type
.
GetCustomAttributes
(
false
).
SingleOrDefault
(
attr
=>
attr
.
GetType
().
Name
==
"TableAttribute"
)
as
dynamic
;
var
table
A
ttr
=
type
.
GetCustomAttributes
(
false
).
SingleOrDefault
(
attr
=>
attr
.
GetType
().
Name
==
"TableAttribute"
)
as
dynamic
;
if
(
table
a
ttr
!=
null
)
if
(
table
A
ttr
!=
null
)
name
=
table
a
ttr
.
Name
;
name
=
table
A
ttr
.
Name
;
else
else
{
{
name
=
type
.
Name
+
"s"
;
name
=
type
.
Name
+
"s"
;
...
...
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