Let's separate it into different bits:
private List<Label> CreateLabels(params string[] names)
This means we're declaring a method returning a list of Label references. We're taking an array of string references as a parameters, and it's declared as a parameter array which means callers can just specify the arguments like this:
List<Label> labels = CreateLabels("first", "second", "third");
(Or they can explicitly pass in an array of strings as normal.)
Now to understand the body, we'll split it up like this:
IEnumerable<Labael> labels = names.Select(x => new Label { ID = 0, Name = x });
List<Label> list = new List<Label>(labels);
return list;
The second and third lines should be fairly simple - it's just constructing a List<Label> from a sequence of labels, and then returning it. The first line is likely to be the one causing problems.
Select is an extension method on the generic IEnumerable<T> type (a sequence of elements of type T) which lazily returns a new sequence by executing a projection in the form of a delegate.
In this case, the delegate is specified with a lambda expression like this:
x => new Label { ID = 0, Name = x }
That says, "Given x, create a Label and set its ID property to 0, and its Name property to x." Here the type of x is inferred to be string because we're calling Select on a string array. This isn't just using a lambda expression, but also an object initializer expression. The new Label { ID = 0, Name = x } part is equivalent to:
Label tmp = new Label();
tmp.ID = 0;
tmp.Name = x;
Label result = tmp;
We could have written a separate method to do this:
private static Label CreateLabel(string x)
{
Label tmp = new Label();
tmp.ID = 0;
tmp.Name = x;
return tmp;
}
and then called:
IEnumerable<Label> labels = names.Select(CreateLabel);
That's effectively what the compiler's doing for you behind the scenes.
So the projection creates a sequence of labels with the names given by the parameter. The code then creates a list of labels from that sequence, and returns it.
Note that it would (IMO) be more idiomatic LINQ to have written:
return names.Select(x => new Label { ID = 0, Name = x }).ToList();
rather than explicitly creating the List<Label>.