修改错误

This commit is contained in:
柳文翔 2024-03-12 10:11:17 +08:00
parent 2d7e1fb609
commit 2ce73fd57b

View File

@ -34,7 +34,9 @@ public class TrackPullCacheService : ApplicationService, ITrackPullCacheService,
{ {
var data = new TrackPullConfigDto(); var data = new TrackPullConfigDto();
Expression<Func<TrackPullConfigEntity, bool>> exp = x => id.HasValue ? x.Id == id : x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId; Expression<Func<TrackPullConfigEntity, bool>> exp = x =>
(!id.HasValue || x.Id == id) && (id.HasValue || (x.SubSystemId == subSystemId && x.ServiceProviderId == serviceProviderId));
var trackPullConfigEntity = await _trackPullConfigRepository.GetFirstAsync(exp); var trackPullConfigEntity = await _trackPullConfigRepository.GetFirstAsync(exp);
if (trackPullConfigEntity == null) return data; if (trackPullConfigEntity == null) return data;