How do I use lazy with an initializer?

I have an array where I initialize its value at declaration time, like this:

Foo[] f = Foo[] { new Foo { y = 1 }, new Foo { y = 3 } };

How do I use lazy in this?

imaginary code

Lazy<Foo[]> f = new Lazy<Foo[]> { new Foo { y = 1 }, new Foo { y = 3 } };

Answers


I'm thinking like this:

Lazy<Foo[]> f = new Lazy<Foo[]>(() => new[] { new Foo { y = 1 }, new Foo { y = 3 } });

Need Your Help

Dynamicaly add images in DIV one by one

javascript jquery

In the i have 9 images , i want to write Jquery code to add only first 3 and last 3 images to from the selected image .suppose user clicks on 4 then add 1,2,3 to one class and 5,6,7, into another...

Clustering Textentities with Radpiminer

cluster-analysis k-means rapidminer

I have cloud tags A,B,C. each cloud tag consists of entities (words) e,f,g ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.