I am simply incrementing a static global variable in a Dynamics CRM 2016 plugin and it shows strange random pattern as shown below. Why does it show strange behavior and pattern?
Below is the code I am using.
public class MyPlugin : IPlugin
{
private static int count = 0;
public void Execute(IServiceProvider serviceProvider)
{
try
{
if (_objContext.InputParameters.Contains("Target") && _objContext.InputParameters["Target"] is Entity)
{
WriteLog("Count value before increament: " + count, service);
count = count + 1;
WriteLog("Count value after increament: "+count, service);
}
}
}
}