Mani Pazhana
asked on
Need help on C# Linq query on object
Hello Experts,
i have the following C# data object: image attached.
1. I want to write a C# LINQ query to group by Model ID and Sum of Stock QTY
Output Should be :
ModelID Model TotalStockQty
163041 WHA-024-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 3
163042 WHA-009-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 17
2. Use the Same Data(Image attached) Next LINQ query - I want to pass ModelID and get Model details
Output should be: (for model ID: 163041 )
Model Available Date Stock Qty
WHA-024-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 1/15/2017 12:00:00 AM 1
WHA-024-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 1/23/2017 12:00:00 AM 2
(for model ID: 163042 )
WHA-009-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 1/29/2017 12:00:00 AM 7
WHA-009-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 2/15/2017 12:00:00 AM 5
WHA-009-C-0-3-1-000-00:00- 0A-00-00-B 0000-00000 2/21/2017 12:00:00 AM 5
Can someone help with LINQ C# query?
Thanks
StockSchedule.JPG
i have the following C# data object: image attached.
1. I want to write a C# LINQ query to group by Model ID and Sum of Stock QTY
Output Should be :
ModelID Model TotalStockQty
163041 WHA-024-C-0-3-1-000-00:00-
163042 WHA-009-C-0-3-1-000-00:00-
2. Use the Same Data(Image attached) Next LINQ query - I want to pass ModelID and get Model details
Output should be: (for model ID: 163041 )
Model Available Date Stock Qty
WHA-024-C-0-3-1-000-00:00-
WHA-024-C-0-3-1-000-00:00-
(for model ID: 163042 )
WHA-009-C-0-3-1-000-00:00-
WHA-009-C-0-3-1-000-00:00-
WHA-009-C-0-3-1-000-00:00-
Can someone help with LINQ C# query?
Thanks
StockSchedule.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi mani_sai;
If any or all of the posted solutions answered the question please close the question by assigning points or if not please post a followup question.
If any or all of the posted solutions answered the question please close the question by assigning points or if not please post a followup question.
ASKER
Thanks
ASKER