Variable Used For Output parameter not detected as "used", even though it is used in the BizTalk Orchestration

40 Views Asked by At

I have a method like this:

CreateOrder(XmlDocument OrderData, out int OrderId);

This method is called from an Expression shape in an orchestration. However, during compilation, a warning like this comes up:

'OrderId' is initialized but its value is never used

OrderId is a variable created within the proper scope in the orchestration and the method is correctly called from an expression within that scope. Question is, why does the compiler flag this variable as unused?

1

There are 1 best solutions below

0
Dijkgraaf On

You might hit the same issue as per How do I pass an "out int" parameter in BizTalk orchestration?

So you are probably better having your CreateOrder Return the OrderId, rather than using an out parameter. e.g.

OrderId = CreateOrder(XmlDocument OrderData);