Horje
Create a list of 3 Orders c# Code Example
Create a list of 3 Orders c#
using System;
using System.Collections.Generic;

namespace ConsoleApp5
{
    class Program
    {
        static void Main(string[] args)
        {
                var obj = new Class1();
                obj.Test();
        }
    }

    public class Class1
    {
        public void Test()
        {
            var myList = new List<MyObject>();

            myList.Add(new MyObject { Id = 1, Name = "ZZZ" });
            myList.Add(new MyObject { Id = 2, Name = "NNN" });
            myList.Add(new MyObject { Id = 3, Name = "PPP" });
            myList.Add(new MyObject { Id = 4, Name = "AAA" });

            foreach (var obj in myList)
            {
                Console.WriteLine($"{obj.Name} -> {obj.Id}");
            }

        }

        public class MyObject
        {
            public int Id { get; set; }
            public string Name { get; set; }

        }
    }
}




Csharp

Related
unity how to make gamemanager instance Code Example unity how to make gamemanager instance Code Example
discord bot c# how to refresh message Code Example discord bot c# how to refresh message Code Example
c# remove exit icon Code Example c# remove exit icon Code Example
format of money value in c# Code Example format of money value in c# Code Example
binary search tree c# stackoverflow Code Example binary search tree c# stackoverflow Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
12