have this C# code
string[] statuses = { "created", "paid", "pending", "authorized", "shipping", "completed", "canceled", "expired" };
string status = "pending";
if (Array.Exists(statuses, element => element == status.Trim())){
context.Response.Write("match!");
}
it is inside *.ashx file. Tested on two IIS servers, on the first one it works fine, but on the second - have this error
Compiler Error Message: CS1525: Invalid expression term '>'
I am newbie in .net, but looks like compiler there think that >
is the part of lambda expression, while expression should only start after =>
, can somebody explain to me, please, why this happens and where I am wrong?
Thanks.