developer

Split List into Sublists with LINQ

Question: ❓❓❓ Is there any way I can separate a List<SomeObject> into several separate lists of SomeObject, using the item index as the delimiter of each split? Let me exemplify: I have a List<SomeObject> and I need a List<List<SomeObject>> or List<SomeObject>[], so that each of these resulting lists will contain Read more…

By admin, ago
developer

LINQ Orderby Descending Query

Question: ❓❓❓ I’m sure this will be a relatively simple one. I have a LINQ query that I want to order by the most recently created date. See: var itemList = from t in ctn.Items where !t.Items && t.DeliverySelection orderby t.Delivery.SubmissionDate descending select t; I have also tried: var itemList Read more…

By admin, ago
developer

LEFT OUTER JOIN in LINQ

Question: ❓❓❓ How to perform left outer join in C# LINQ to objects without using join-on-equals-into clauses? Is there any way to do that with where clause? Correct problem: For inner join is easy and I have a solution like this List<JoinPair> innerFinal = (from l in lefts from r Read more…

By admin, ago