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
ff2c70d0
Commit
ff2c70d0
authored
Aug 20, 2017
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup
parent
bdebedea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
DynamicParameters.cs
Dapper/DynamicParameters.cs
+1
-1
SqlMapper.cs
Dapper/SqlMapper.cs
+2
-2
No files found.
Dapper/DynamicParameters.cs
View file @
ff2c70d0
...
...
@@ -343,7 +343,7 @@ public DynamicParameters Output<T>(T target, Expression<Func<T, object>> express
{
var
failMessage
=
"Expression must be a property/field chain off of a(n) {0} instance"
;
failMessage
=
string
.
Format
(
failMessage
,
typeof
(
T
).
Name
);
Action
@throw
=
()
=>
{
throw
new
InvalidOperationException
(
failMessage
);
}
;
Action
@throw
=
()
=>
throw
new
InvalidOperationException
(
failMessage
)
;
// Is it even a MemberExpression?
var
lastMemberAccess
=
expression
.
Body
as
MemberExpression
;
...
...
Dapper/SqlMapper.cs
View file @
ff2c70d0
...
...
@@ -1948,7 +1948,7 @@ internal static int GetListPaddingExtraCount(int count)
private
static
string
GetInListRegex
(
string
name
,
bool
byPosition
)
=>
byPosition
?
(
@"(\?)"
+
Regex
.
Escape
(
name
)
+
@"\?(?!\w)(\s+(?i)unknown(?-i))?"
)
:
(
@
"([?@:]"
+
Regex
.
Escape
(
name
)
+
@")(?!\w)(\s+(?i)unknown(?-i))?"
);
:
(
"([?@:]"
+
Regex
.
Escape
(
name
)
+
@")(?!\w)(\s+(?i)unknown(?-i))?"
);
/// <summary>
/// Internal use only.
...
...
@@ -2219,7 +2219,7 @@ public static object SanitizeParameterValue(object value)
private
static
IEnumerable
<
PropertyInfo
>
FilterParameters
(
IEnumerable
<
PropertyInfo
>
parameters
,
string
sql
)
{
return
parameters
.
Where
(
p
=>
Regex
.
IsMatch
(
sql
,
@
"[?@:]"
+
p
.
Name
+
@"([^\p{L}\p{N}_]+|$)"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
|
RegexOptions
.
CultureInvariant
));
return
parameters
.
Where
(
p
=>
Regex
.
IsMatch
(
sql
,
"[?@:]"
+
p
.
Name
+
@"([^\p{L}\p{N}_]+|$)"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Multiline
|
RegexOptions
.
CultureInvariant
));
}
// look for ? / @ / : *by itself*
...
...
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