Hello,
iam getting error as Drop 'Where' and move the condition into the 'FirstOrDefault' for following linq code in Sonar Cube .. Please suggest how to fix and how can we move Where condition to FirstOrDefault
Entity docLocation = entityCollection.Entities.Count > 0 ? entityCollection.Entities.Where(s => parentLocationRecord.Id == (s.Contains("parentsiteorlocation") ? ((EntityReference)s["parentsiteorlocation"]).Id : Guid.Empty) && _recordId == (s.Contains("regardingobjectid") ? ((EntityReference)s["regardingobjectid"]).Id : Guid.Empty)).FirstOrDefault() : null;
*This post is locked for comments