Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Updating the TypedXmlDocument in BRE from a .NET Static Method (to add a new node) › Re: Updating the TypedXmlDocument in BRE from a .NET Static Method (to add a new node)
I’m pretty sure what I need to do is update the TypedXmlDocument with my new xml without constructing a new TypedXmlDocument.
I proved that if you construct a new object, it won’t pass back with this code:
namespace
TestPassObjectCons
{
class Program
{
static void Main(string[] args)
{
employee objEmployee = new employee();
objEmployee.lastname =
“Walters”;
objEmployee.firstname = “Neal”;
subs.mysub(objEmployee);
Console.WriteLine(“Result lastname=” + objEmployee.lastname);
Console.ReadLine();
}
}
public class employee
{
public string lastname;
public string firstname;
}
public class subs
{
public static void mysub(employee passEmp)
{
//passEmp.lastname = “Something else”; // (this sends back the changed value)
employee newEmployee = new employee();
newEmployee.lastname =
“Something else”;
newEmployee.firstname =
“John”;
passEmp = newEmployee; // this does not send back the changed value
return;
}
}
}