Conversation
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |
1 similar comment
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |
| } | ||
| } | ||
|
|
||
| predicate = predicate.And(acquisitionPredicate.Or(leasePredicate)); |
There was a problem hiding this comment.
Didn't check this locally, but acquisitionPredicate and leasePredicate seem to be initialized with true, and only filtered when includeAcquisitions or includeLeases is true.
If one of those is false, the predicate would remain true which would seem to be a problem given the Or statement.
There was a problem hiding this comment.
You are right. I'm putting a fix to initialize the predicates to false when their respective flag is disabled, so the Or doesn't swallow everything:
var acquisitionPredicate = PredicateBuilder.New<PimsCompReqFinancial>(includeAcquisitions);
// ...
var leasePredicate = PredicateBuilder.New<PimsCompReqFinancial>(includeLeases);| if (contractorPersonId is not null) | ||
| { | ||
| query = query.Where(p => p.LeasePeriod.Lease.PimsLeaseLicenseTeams.Any(lt => lt.PersonId == contractorPersonId) || | ||
| p.LeasePeriod.Lease.Project.PimsProjectPeople.Any(pp => pp.PersonId == contractorPersonId)); |
There was a problem hiding this comment.
Project isn't a required field is it? can this throw an NPE?
There was a problem hiding this comment.
good catch - will fix
…and contractor filtering
6a57e4a to
3e91cef
Compare
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |
| return PidTranslator.ConvertPIDToDash(property.Pid.ToString()); | ||
| } | ||
|
|
||
| if (property?.Pin != null) |
Check warning
Code scanning / CodeQL
Constant condition Warning
| return PidTranslator.ConvertPIDToDash(property.Pid.ToString()); | ||
| } | ||
|
|
||
| if (property?.Pin != null) |
Check warning
Code scanning / CodeQL
Constant condition Warning
| return property.Pin.ToString(); | ||
| } | ||
|
|
||
| if (property?.Address != null && !string.IsNullOrEmpty(property.Address.StreetAddress1)) |
Check warning
Code scanning / CodeQL
Constant condition Warning
| return property.Pin.ToString(); | ||
| } | ||
|
|
||
| if (property?.Address != null && !string.IsNullOrEmpty(property.Address.StreetAddress1)) |
Check warning
Code scanning / CodeQL
Constant condition Warning
| return $"({propertyLease.Name})"; | ||
| } | ||
|
|
||
| if (property?.Location != null) |
Check warning
Code scanning / CodeQL
Constant condition Warning
| return $"({propertyLease.Name})"; | ||
| } | ||
|
|
||
| if (property?.Location != null) |
Check warning
Code scanning / CodeQL
Constant condition Warning
|
|
See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/5208 |



No description provided.