C#C
C#4y ago
Yashogi

❔ Query won't filter

I am trying to filter by one of these two search options, they both show up properly in the network but nothing displays when I run the filter functions. Anyone see anything wrong?
        public List<RollingStockList> FindRollingStocksByPartialReportingMark(string partialReportingMark)
        {
            Console.WriteLine($"RollingStockServices: FindByPartialName(); partialName= {partialReportingMark}");
            var info =
                Context.RollingStocks
                .Where(x => x.ReportingMark.Contains(partialReportingMark))
                .Select(x => new RollingStockList
                {
                    ReportingMark = x.ReportingMark,
                    Owner = x.Owner,
                    LightWeight = x.LightWeight,
                    LoadLimit = x.LoadLimit,
                    RailCarType = x.RailCarType.Name,
                    YearBuilt = x.YearBuilt,
                    InService = x.InService,
                    Notes = x.Notes
                })
                .OrderBy(x => x.ReportingMark);
            return info.ToList();
}   
empty_query.png
Was this page helpful?