Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SieveModel Submodule Test
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
nguyenvu
SieveModel Submodule Test
Commits
ed9a83e8
Commit
ed9a83e8
authored
Apr 18, 2020
by
thienvo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed sieve processor id>0 expression
parent
40ae5b61
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
SieveProcessor.cs
Sieve/Services/SieveProcessor.cs
+17
-1
No files found.
Sieve/Services/SieveProcessor.cs
View file @
ed9a83e8
...
@@ -274,6 +274,21 @@ namespace Sieve.Services
...
@@ -274,6 +274,21 @@ namespace Sieve.Services
return
fullQueryString
;
return
fullQueryString
;
}
}
protected
object
ChangeType
(
object
value
,
Type
conversion
)
{
var
t
=
conversion
;
if
(
t
.
IsGenericType
&&
t
.
GetGenericTypeDefinition
().
Equals
(
typeof
(
Nullable
<>)))
{
if
(
value
==
null
)
{
return
null
;
}
t
=
Nullable
.
GetUnderlyingType
(
t
);
}
return
Convert
.
ChangeType
(
value
,
t
);
}
public
Expression
<
Func
<
TEntity
,
bool
>>
GetFilterExpressionQuery
<
TEntity
>(
public
Expression
<
Func
<
TEntity
,
bool
>>
GetFilterExpressionQuery
<
TEntity
>(
TSieveModel
model
,
TSieveModel
model
,
bool
bCaseSensitive
=
false
)
bool
bCaseSensitive
=
false
)
...
@@ -284,8 +299,9 @@ namespace Sieve.Services
...
@@ -284,8 +299,9 @@ namespace Sieve.Services
if
(
model
?.
GetFiltersParsed
()
==
null
)
if
(
model
?.
GetFiltersParsed
()
==
null
)
{
{
var
property
=
Expression
.
Property
(
parameterExpression
,
"id"
);
var
property
=
Expression
.
Property
(
parameterExpression
,
"id"
);
ConstantExpression
constant
=
Expression
.
Constant
(
0
,
typeof
(
int
)
);
ConstantExpression
constant
=
Expression
.
Constant
(
this
.
ChangeType
(
0
,
property
.
Type
),
property
.
Type
);
var
rst
=
Expression
.
GreaterThan
(
property
,
constant
);
var
rst
=
Expression
.
GreaterThan
(
property
,
constant
);
return
Expression
.
Lambda
<
Func
<
TEntity
,
bool
>>(
rst
,
parameterExpression
);
return
Expression
.
Lambda
<
Func
<
TEntity
,
bool
>>(
rst
,
parameterExpression
);
}
}
...
...
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