I have a DAL method that retrieves elements. Elements exist in the DAL method, but not in the calling code. How is this possible?
Call Code:
IEnumerable<InstallationSummary> installationSummaryList = InstallationSummaryLogic.GetByServerAppAndGroup(appServer, appWithValidGroup);
The DAL method shows that the elements really exist:
Call code that does not display any items. Where did they go?
(This is the same line shown at the top of this question.)
The only thing that exists between the DAL method and the calling code is a boolean class that is simply pass-through. For completeness, I have included it here:
public static IEnumerable<InstallationSummary> GetByServerAppAndGroup(ApplicationServer appServer, ApplicationWithOverrideVariableGroup appWithGroup) { return DataAccessFactory.GetDataInterface<IInstallationSummaryData>().GetByServerAppAndGroup(appServer, appWithGroup); }
Edit - Show the entire DAL method
public IEnumerable<InstallationSummary> GetByServerAppAndGroup(ApplicationServer appServer, ApplicationWithOverrideVariableGroup appWithGroup) { IQueryable<InstallationSummary> summaries = this.Database.InstallationSummaries .Include(x => x.ApplicationServer) .Include(x => x.ApplicationWithOverrideVariableGroup.Application) .Include(x => x.ApplicationWithOverrideVariableGroup.CustomVariableGroup) .Where(x => x.ApplicationServer.IdForEf == appServer.IdForEf) .Where(x => x.ApplicationWithOverrideVariableGroup.Application.IdForEf == appWithGroup.Application.IdForEf); if (appWithGroup.CustomVariableGroup == null) { return summaries.Where(x => x.ApplicationWithOverrideVariableGroup.CustomVariableGroup == null); } return summaries .Where(x => x.ApplicationWithOverrideVariableGroup != null && x.ApplicationWithOverrideVariableGroup.CustomVariableGroup != null && x.ApplicationWithOverrideVariableGroup.CustomVariableGroup.IdForEf == appWithGroup.CustomVariableGroup.IdForEf); }
source share