Can anybody please tell me what is happening in below code in simple English, specifically around the usage of =>
and +=
symbols:
var ls = new LibraryServiceClient(AppSettings.Get("LibraryServiceBaseAddress"),
SessionId, App.Id, _user.UUID);
ls.MakingRequest += (s, e) =>
{
LogStash.LogDebug("Library Service | Before making request : {0}",
DateTime.UtcNow.ToString("HH:mm:ss.fff"));
};
You assign a new delegate to the event:
ls.MakingRequest +=
You create a lambda expression, a function having two parameters, s
and e
:
(s, e) =>
Where the action of the lambda expression is:
{ LogStash.LogDebug("Library Service | Before making request : {0}", DateTime.UtcNow.ToString("HH:mm:ss.fff"));
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