G
Guest
Hey,
Am trying to write a lambda expression for a delegate, am getting an error as
------------------------------
only assignment, call, increment, decrement, and new expression can be used
as a statement
-----------------------------
For the following code.
// Delegate Declaration
delegate void dgSmp(string str);
//Lambda Expression
dgSmp dbObj = x => x + " Morning "; // Here throws the error
string strX = dbObj("Happy "); // expted value at strX is "Happy Morning"
------------------------------------------
Can some one help me to understand where i went wrong ..
Thanks
Ruth
Am trying to write a lambda expression for a delegate, am getting an error as
------------------------------
only assignment, call, increment, decrement, and new expression can be used
as a statement
-----------------------------
For the following code.
// Delegate Declaration
delegate void dgSmp(string str);
//Lambda Expression
dgSmp dbObj = x => x + " Morning "; // Here throws the error
string strX = dbObj("Happy "); // expted value at strX is "Happy Morning"
------------------------------------------
Can some one help me to understand where i went wrong ..
Thanks
Ruth