title: Linq Xelement and Class
body: <p>So, let me explain my trouble.</p>
  
  <p>I get a project which was develop by another guy, and he leaved the firm. Now i have to update the program but something going wrong when i import the solution.</p>
  
  <p>Let see the code:</p>
  
  <pre><code>  ListeDeTypeDePoste = (from e in xml.Descendants("profil")
                                select new TypeDePoste()
                                {
                                    Nom = e.Element("name").Value,
                                    Chaines = (from c in e.Elements("Chaine")
                                               select new Chaine()
                                               {
                                                   Code = c.Element("Code")?.Value,
                                                   Type = c.Element("Type")?.Value,
                                                   Nom = c.Element("Nom")?.Value,
                                                   OU = c.Element("OU")?.Value
                                               }).ToList()
                                }).ToList&lt;TypeDePoste&gt;();
  </code></pre>
  
  <p>The trouble is on the <code>.?Value</code> for each properties in a Chaine Class, when i debug i can even debug the solution and if i remove them i got a  NullReferenceException. With this code the previous realese .exe worked like a charm </p>