Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<IntelHexModel> arr = new List<IntelHexModel>();
- arr.Add(new IntelHexModel() { RealAddress = 5 });
- arr.Add(new IntelHexModel() { RealAddress = 4 });
- arr.Add(new IntelHexModel() { RealAddress = 3 });
- List<IntelHexModel> arr2 = new List<IntelHexModel>();
- arr2.Add(new IntelHexModel() { RealAddress = 7 });
- arr2.Add(new IntelHexModel() { RealAddress = 15 });
- arr2.Add(new IntelHexModel() { RealAddress = 1 });
- List<IntelHexModel> arr3 = new List<IntelHexModel>();
- arr3.Add(new IntelHexModel() { RealAddress = 123 });
- arr3.Add(new IntelHexModel() { RealAddress = 2 });
- arr3.Add(new IntelHexModel() { RealAddress = 6 });
- arr3.Add(new IntelHexModel() { RealAddress = 66 });
- List<List<IntelHexModel>> test = new List<List<IntelHexModel>>();
- test.Add(arr);
- test.Add(arr2);
- test.Add(arr3);
- var orderd = (from subList in test
- from subsubArr in subList
- orderby subsubArr.RealAddress
- group subsubArr by subList into ret
- select ret.ToList()).ToList();
- }
- }
- class IntelHexModel
- {
- public int RealAddress { get; set; }
- }
- }
Add Comment
Please, Sign In to add comment