Why assign a private field a lamba expression?

I was looking at some code at work and came across something I'm not familiar with.

here is full property im familiar with:

private int myVar; public int MyProperty { get { return myVar; } set { myVar = value; } } 

but then I saw (and I can't recall exactly atm) this:

private int myVar = (x => x.Something); //public int MyProperty //{ // get { return myVar; } // set { myVar = value; } //} 

the field of some type (can't recall type atm) was assigned a lambda!?

I'll just add this was in application that uses CSLA, but I'd like to find out why private backing field would be assigned a lamba.

by Karmadilla via /r/csharp

Leave a Reply