"Add Extension Method when Trying to Use Collection Initializer"

static class UserDatabaseExtensions {
	public static void Add(this UserDatabase @this, User u) => @this.AddUser(u);
}

// ...

static void Test() {
	// Hooray, this works now!
	var database = new UserDatabase {
		new User("Ben", 30),
		new User("Seb", 27),
		new User("Rob", 33)
	};
}


Code snippet taken from "Two Decades of C#: A Reference - C# 5 and C# 6".