Eq() function will return true if one string parameter is null and other string parameter is Empty

This commit is contained in:
NileshGhodekar 2018-11-10 18:54:00 +00:00
Родитель 75b1deee9a
Коммит 32b7df8b8a
1 изменённых файлов: 13 добавлений и 6 удалений

Просмотреть файл

@ -792,13 +792,24 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
try
{
bool result;
bool result = false;
if (this.mode != EvaluationMode.Parse)
{
if (this.parameters[0] == null || this.parameters[1] == null)
{
result = this.parameters[0] == null && this.parameters[1] == null;
if (this.parameters[0] == null && this.parameters[1] == null)
{
result = true;
}
else if (this.parameters[0] == null && this.VerifyType(this.parameters[1], typeof(string)))
{
result = string.IsNullOrEmpty(this.parameters[1] as string);
}
else if (this.parameters[1] == null && this.VerifyType(this.parameters[0], typeof(string)))
{
result = string.IsNullOrEmpty(this.parameters[0] as string);
}
}
else if (this.VerifyType(this.parameters[0], typeof(string)) && this.VerifyType(this.parameters[1], typeof(string)))
{
@ -822,10 +833,6 @@ namespace MicrosoftServices.IdentityManagement.WorkflowActivityLibrary.Common
Logger.Instance.WriteVerbose(EventIdentifier.ExpressionFunctionEqual, "Eq('{0}', '{1}') evaluated '{2}'.", this.parameters[0], this.parameters[1], result);
}
else
{
result = false;
}
return result;
}