.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Collections;
using System.Collections.Generic;
					
public class Program
{
	public static void Main()
	{
		var l = Foo().ToList();
		l.Add(Foo());
		Console.WriteLine(string.Join("/", l));
	}
	
	public static string Foo() => "Hello World";
}

public static class ExtensionsOfT
{
    public static List<T> ToList<T>(this T t) => new List<T>();
}
;