我只是在Dynamics CRM 2016插件中增加静态全局变量,它显示奇怪的随机模式,如下所示.为什么它表现出奇怪的行为和模式?
以下是我正在使用的代码.
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);
}
}
}
}
Run Code Online (Sandbox Code Playgroud)