I've a C# statement as follows:
var errors = errorList.Select((e, i) => string.Format("Error occured #{0}: {1} (Error code = {2}).", i + 1, e.Message, e.ErrorCode)).ToArray();
I need to display "Error occured" when e.ErrorCode is 'Error' and "Warning occured" when e.ErrorCode is 'Warning'. How do I add this condition to the above statement please?
Thanks.
Couldn't you just do this:
errorList.Select((e, i) => string.Format("{2} Occured #{0}: {1} (Error code = {2}).", i + 1, e.Message, e.ErrorCode)).ToArray();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With