public static List <Part> GetPartsWithoutSpoilages() { var paRep = new PartRepository(); var parts = paRep.All().ToList(); return(parts.Where(p => p.Spoilages.Count < 1).ToList()); }
public static Part GetHighestValue() { //Static method that returns the Part with the highest current inventory value as a public static method. var paRep = new PartRepository(); var parts = paRep.All().ToList(); return(parts.OrderByDescending(p => p.CurrentValue).FirstOrDefault()); }
public static Dictionary <int, Part> GetPartDictionary() { //Static method that returns the Part with the highest current inventory value as a public static method. var paRep = new PartRepository(); var parts = paRep.All().ToList(); //return (from part in parts group part by part.PartId into pg select pg).ToDictionary(); return(parts.ToDictionary(p => p.PartId)); }