ちょっと試しに。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
public partial class Form1 : Form { public Form1() { InitializeComponent(); List<TestModel> MyModel = new List<TestModel>(); for (int i = 0; i < 10000; i++) { MyModel.Add( new TestModel() { Name = "taro", Quantity = new Quantity(i) } ); } MessageBox.Show( MyModel[9999].NameReverse() + " さん。" + MyModel[9999].Quantity.Value.ToString() ); } } class TestModel { public string NameReverse() { return string.Join("",Name.ToCharArray().Reverse()); } public string Name; public Quantity Quantity; } class Quantity { public int Value { get; } public Quantity(int qty) { Value = qty; } } |