In General,

Now we can restrict it, with LAZY keyword.
- Lazy<Program> pro = new Lazy<Program>();
Finally Implementation.
- try
- {
- Program prgm = new Program();
- prgm.Sample();
- Lazy < Program > pro = new Lazy < Program > ();
- var Getvalue = pro.Value;
- Console.Read();
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message.ToString());
- Console.Read();
- }



Manas MohapatraPosted Dec 13, 2015, 11:46 PM EST
Good one
Maruthi PalllamalliPosted Dec 13, 2015, 7:15 PM EST
You can use it for thread safety with out need any lock mechanism. Lot of changes has been made in design patterns with this lazy keyword.
Ehsan SajjadPosted Dec 13, 2015, 4:33 AM EST
Where this can be useful i am wondering