title: How can I cast a System.Guid to a string in C#
body: <p>I have the following field definition in a class:</p>
  
  <pre><code>   public Nullable&lt;System.Guid&gt; GlobalId { get; set; }
  </code></pre>
  
  <p>I have another class with the following:</p>
  
  <pre><code>   public string GlobalId { get; set; }
  </code></pre>
  
  <p>I would like to put the value of from the field with type System.Guid into the string. </p>
  
  <p>I tried to do this here:</p>
  
  <pre><code>        var questionIds = _questionsRepository.GetAll()
              .Where(m =&gt; m.Problem != null &amp;&amp;
              m.Problem.SubTopic != null &amp;&amp;
              m.Problem.SubTopic.Topic != null &amp;&amp;
              m.Problem.SubTopic.Topic.SubjectId == 1)
              .Select(m =&gt; new QuestionHeader { GlobalId = (string) m.GlobalId })
              .ToList();
          return questionIds;
  </code></pre>
  
  <p>But it's giving me an error saying:</p>
  
  <pre><code>   Cannot convert type 'System.Guid?' to 'string'
  </code></pre>
  
  <p>Can someone tell me how I could do this?</p>