Nonsense not much to say, look at the code:
Method One:
list<string> t = new list<string> (); Original
list<string> t2 = new List<string> (T.toarray ()); Copy of T
Method Two:
It is a one liner using LINQ.
List<string> List1 = new list<string> ();
list<string> list2 = new list<string> ();
This would copy all of the items from List 1 to List 2
List1. ForEach (i = List2. ADD (i));
Method Three:
Using System;
Using System.Linq;
Using System.Collections.Generic;
Using System.Diagnostics;
Namespace Delegates
{
Class X
{
public int Id {get; set;}
public string Name {get; set;}
}
Class Y
{
public int Id {get; set;}
public string Name {get; set;}
}
Class Program
{
static void Main (string[] args)
{
list<x> X = new list<x> ();
for (int i = 0; i <; i++)
X.add (new X {Id = i, Name = string.) Format ("x_{0}", i.ToString ())});
Copy x to Y
list<y> Y = new List<y> (x.convertall<y> (e + = {return new Y {Id = e.id, Name = E.name};}));
Debug.Assert (X.count = = Y.count);
}
}
}