title: How can I get the shared steps details for a test case using the .NET SDK client?
body: <p>I use the .NET SDK client (version 16.156.0-preview available on NuGet), but I search how I can get the test case steps that contain the shared steps.
  The field <code>parameterizedString</code> seems to contain all the test steps, but when it contains the shared steps, the XML content is not clear.</p>
  
  <p>Example of the code I use to get all test steps for a test case:</p>
  
  <pre class="lang-cs prettyprint-override"><code>private void ReadTestCaseSteps(Microsoft.VisualStudio.Services.TestManagement.TestPlanning.WebApi.TestCase testCase)
  {
      foreach (var field in testCase.workItem.WorkItemFields.OfType&lt;JObject&gt;())
      {
          var stepsContent = ((JValue)((JContainer)field.First).First).Value.ToString();
  
          using (TextReader stepsReader = new StringReader(stepsContent))
          {
              var serializer = new XmlSerializer(typeof(steps));
              var steps = (steps)serializer.Deserialize(stepsReader);
          }
      }
  }
  </code></pre>
  
  <p>The class "steps" is an XML description of this sample:</p>
  
  <pre class="lang-cs prettyprint-override"><code>// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  [System.Xml.Serialization.XmlRootAttribute(Namespace = "", IsNullable = false)]
  public partial class steps
  {
  
      private stepsStep stepField;
  
      private stepsCompref comprefField;
  
      private byte idField;
  
      private byte lastField;
  
      /// &lt;remarks/&gt;
      public stepsStep step
      {
          get
          {
              return this.stepField;
          }
          set
          {
              this.stepField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      public stepsCompref compref
      {
          get
          {
              return this.comprefField;
          }
          set
          {
              this.comprefField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte last
      {
          get
          {
              return this.lastField;
          }
          set
          {
              this.lastField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsStep
  {
  
      private stepsStepParameterizedString[] parameterizedStringField;
  
      private object descriptionField;
  
      private byte idField;
  
      private string typeField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
      public stepsStepParameterizedString[] parameterizedString
      {
          get
          {
              return this.parameterizedStringField;
          }
          set
          {
              this.parameterizedStringField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      public object description
      {
          get
          {
              return this.descriptionField;
          }
          set
          {
              this.descriptionField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string type
      {
          get
          {
              return this.typeField;
          }
          set
          {
              this.typeField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsStepParameterizedString
  {
  
      private bool isformattedField;
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool isformatted
      {
          get
          {
              return this.isformattedField;
          }
          set
          {
              this.isformattedField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value
      {
          get
          {
              return this.valueField;
          }
          set
          {
              this.valueField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsCompref
  {
  
      private stepsComprefStep[] stepField;
  
      private stepsComprefCompref comprefField;
  
      private byte idField;
  
      private ushort refField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("step")]
      public stepsComprefStep[] step
      {
          get
          {
              return this.stepField;
          }
          set
          {
              this.stepField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      public stepsComprefCompref compref
      {
          get
          {
              return this.comprefField;
          }
          set
          {
              this.comprefField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public ushort @ref
      {
          get
          {
              return this.refField;
          }
          set
          {
              this.refField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsComprefStep
  {
  
      private stepsComprefStepParameterizedString[] parameterizedStringField;
  
      private object descriptionField;
  
      private byte idField;
  
      private string typeField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
      public stepsComprefStepParameterizedString[] parameterizedString
      {
          get
          {
              return this.parameterizedStringField;
          }
          set
          {
              this.parameterizedStringField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      public object description
      {
          get
          {
              return this.descriptionField;
          }
          set
          {
              this.descriptionField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string type
      {
          get
          {
              return this.typeField;
          }
          set
          {
              this.typeField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsComprefStepParameterizedString
  {
  
      private bool isformattedField;
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool isformatted
      {
          get
          {
              return this.isformattedField;
          }
          set
          {
              this.isformattedField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value
      {
          get
          {
              return this.valueField;
          }
          set
          {
              this.valueField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsComprefCompref
  {
  
      private stepsComprefComprefStep[] stepField;
  
      private byte idField;
  
      private ushort refField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("step")]
      public stepsComprefComprefStep[] step
      {
          get
          {
              return this.stepField;
          }
          set
          {
              this.stepField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public ushort @ref
      {
          get
          {
              return this.refField;
          }
          set
          {
              this.refField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsComprefComprefStep
  {
  
      private stepsComprefComprefStepParameterizedString[] parameterizedStringField;
  
      private object descriptionField;
  
      private byte idField;
  
      private string typeField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlElementAttribute("parameterizedString")]
      public stepsComprefComprefStepParameterizedString[] parameterizedString
      {
          get
          {
              return this.parameterizedStringField;
          }
          set
          {
              this.parameterizedStringField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      public object description
      {
          get
          {
              return this.descriptionField;
          }
          set
          {
              this.descriptionField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public byte id
      {
          get
          {
              return this.idField;
          }
          set
          {
              this.idField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public string type
      {
          get
          {
              return this.typeField;
          }
          set
          {
              this.typeField = value;
          }
      }
  }
  
  /// &lt;remarks/&gt;
  [System.SerializableAttribute()]
  [System.ComponentModel.DesignerCategoryAttribute("code")]
  [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)]
  public partial class stepsComprefComprefStepParameterizedString
  {
  
      private bool isformattedField;
  
      private string valueField;
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlAttributeAttribute()]
      public bool isformatted
      {
          get
          {
              return this.isformattedField;
          }
          set
          {
              this.isformattedField = value;
          }
      }
  
      /// &lt;remarks/&gt;
      [System.Xml.Serialization.XmlTextAttribute()]
      public string Value
      {
          get
          {
              return this.valueField;
          }
          set
          {
              this.valueField = value;
          }
      }
  }
  </code></pre>
  
  <p>The XML that describes the steps with the shared steps can be like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;steps id="0" last="14"&gt;
      &lt;step id="2" type="ValidateStep"&gt;
          &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 1&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
          &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Result 1&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
          &lt;description/&gt;
      &lt;/step&gt;
      &lt;compref id="6" ref="8712"&gt;
          &lt;step id="5" type="ActionStep"&gt;
              &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 4&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
              &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
              &lt;description/&gt;
          &lt;/step&gt;
          &lt;step id="7" type="ActionStep"&gt;
              &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 5&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
              &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
              &lt;description/&gt;
          &lt;/step&gt;
          &lt;compref id="14" ref="8713"&gt;
              &lt;step id="10" type="ActionStep"&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 8&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;description/&gt;
              &lt;/step&gt;
              &lt;step id="11" type="ActionStep"&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 9&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;description/&gt;
              &lt;/step&gt;
              &lt;step id="12" type="ActionStep"&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;Step 10&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;description/&gt;
              &lt;/step&gt;
              &lt;step id="13" type="ActionStep"&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;parameterizedString isformatted="true"&gt;&amp;lt;DIV&amp;gt;&amp;lt;P&amp;gt;&amp;lt;BR/&amp;gt;&amp;lt;/P&amp;gt;&amp;lt;/DIV&amp;gt;&lt;/parameterizedString&gt;
                  &lt;description/&gt;
              &lt;/step&gt;
          &lt;/compref&gt;
      &lt;/compref&gt;
  &lt;/steps&gt;
  </code></pre>
  
  <p>So I don't understand how I can read and manage the test case steps with the shared steps with the API in order to transform this content as a list of the detailed steps (description, expected result).</p>
  
  <p>Could you please advise me?</p>