© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
5 replies
pauleq

❔ Need help with a linq query

Hello, why does this query return nothing
List<Product> failedOrders = (
from order in orderData
from warehouse in warehouseData
from product in warehouse.Products
where product.ProductName == order.OrderName && product.Price <= order.PriceLimit && product.Quantity >= order.OrderQuantity
select new Product(product.ProductName, product.Quantity, product.Price)
).GroupBy(p => p.ProductName)
.Where(g => g.Sum(p => p.Quantity) < (
from o in orderData
where o.OrderName == g.Key
select o.OrderQuantity
).First())
.SelectMany(g => g)
.ToList();
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Need help with a LINQ query
C#CC# / help
4y ago
❔ Help with linq query
C#CC# / help
4y ago
❔ Linq Query HELP
C#CC# / help
3y ago
Help with Linq
C#CC# / help
4y ago