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 14, 2015, 4:46 AM
Good one
Maruthi PalllamalliPosted Dec 14, 2015, 12:15 AM
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, 9:33 AM
Where this can be useful i am wondering