Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ protected async override Task<Action<AsyncCodeActivityContext>> ExecuteInternalA
var currentParam = Parameters[param.Key];
if (currentParam.Direction == ArgumentDirection.Out || currentParam.Direction == ArgumentDirection.InOut)
{
currentParam.Set(asyncCodeActivityContext, param.Value.Value);
if (param.Value.Value != DBNull.Value)
{
currentParam.Set(asyncCodeActivityContext, param.Value.Value);
}
else
{
currentParam.Set(asyncCodeActivityContext, null);
Copy link
Collaborator

@viogroza viogroza Oct 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove the condition on else
if there is nothing to set, I would not set null; (this is a business requirement)
for example if I have a in/out param with the initial value 100, then the procedures value for the param is DbNull.. do we want to set to zero the value in this case? or let it as it was? we can use default instead of null if needed

also null assignment wouldn't work if the type is a value type (eg. integer or bool);
eg.:
object o = null;
bool v = (bool)o;

}
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ protected async override Task<Action<AsyncCodeActivityContext>> ExecuteInternalA
var currentParam = Parameters[param.Key];
if (currentParam.Direction == ArgumentDirection.Out || currentParam.Direction == ArgumentDirection.InOut)
{
currentParam.Set(asyncCodeActivityContext, param.Value.Value);
if (param.Value.Value != DBNull.Value)
{
currentParam.Set(asyncCodeActivityContext, param.Value.Value);
}
else
{
currentParam.Set(asyncCodeActivityContext, null);
}
}
}
};
Expand Down