CRM 2011 CS: SharedVariables in CRM 2011 plugins

// Passing Data to shared Variable
context.SharedVariables.Add("PrimaryContact", (Object)contact.ToString());


// Retrieving data from context shared variables.
Guid contact = new Guid((string)context.SharedVariables["PrimaryContact"]);