title: How to check if ObjectResult<> contains a value
body: <p>How do I check to see if the ObjectResult&lt;> has a value or not? Right now it's returning values but will it throw an exception is there is nothing to return?</p>
  
  <p>This is the section of code that I need to check so I do not have to depend on a try catch block</p>
  
  <hr>
  
  <pre><code>iProjInfo.ProjectLeafs = db.proc_GetProjectLeafs(projectID).ToList&lt;IProjectLeafs&gt;();
  </code></pre>
  
  <hr>
  
  <pre><code>public static Task&lt;IProjectInfo&gt; GetProjectInfo(int projectID)
  {
      return Task.Run(() =&gt;
        {
            using (var db = new StorefrontSystemEntities())
            {
                IProjectInfo iProjInfo = db.proc_GetProject_ForDrawings(projectID).Single&lt;IProjectInfo&gt;();
  
                try
                {
                    iProjInfo.ProjectLeafs = db.proc_GetProjectLeafs(projectID).ToList&lt;IProjectLeafs&gt;();
                }
                catch (Exception ex)
                {
  
                }
                return iProjInfo;
            };
        });
  }
  </code></pre>