Created
April 22, 2022 03:18
-
-
Save 24code/ffa11b3eccacaf2ccc5a117747f67358 to your computer and use it in GitHub Desktop.
查询template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var factory = new FilterConditionFactory<RecommendCodeV2>(); | |
| Condition condition = !factory.Term(r => r.StdIsDeleted, true); | |
| if (param.Type != RecommendCodeType.Default) | |
| { | |
| condition = condition & factory.Term(r => r.Type, ((int)param.Type).ToString()); | |
| } | |
| if (!string.IsNullOrEmpty(param.Value)) | |
| { | |
| condition = condition & factory.Term(r => r.Value, param.Value); | |
| } | |
| if (param.Status != RecommendCodeStatus.Default) | |
| { | |
| condition = condition & factory.Term(r => r.Status, ((int)param.Status).ToString()); | |
| } | |
| if (!string.IsNullOrEmpty(param.Referrer)) | |
| { | |
| condition = condition & factory.Term(r => r.Referrer, param.Referrer); | |
| } | |
| var codes = queryProvider.Filter(f => condition).GetEntities(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment