Is there a way to add items from a list to a queue without using a loop? The following is the code I currently have:
Queue<User> myQueue = new Queue<User>();
List<string> names = new List<string>(){"X", "Y", "Z"};
foreach (var name in names)
{
var response = new User
{
Name = name,
Level = 1
};
myQueue.Enqueue(response);
}