title: ERROR: Cannot convert from DataAccess.Column to int?
body: <p><strong>Problem</strong>: (Error) Cannot convert from 'DataAccess.Column' to 'int'?</p>
  
  <p><strong>Background</strong>: Using object from another solution</p>
  
  <p><strong>I tried</strong>: I tried casting it, but it did not get rid of the error. All of the SO articles I can find mentioned going from something like 'int to string' or 'int to int?' but not from database table object to int? (and vice versa).</p>
  
  <p><strong>File with error</strong>: </p>
  
  <pre><code>public si GetStuff(int iID) 
  {
      using (var ctx = CreateContext())
      {
          var dao = ctx.DBTable.Where(x =&gt; x.ID == iID).ToList().Single();
          return new si.myObject(
              argsomeOtherID: dao.someOtherID;
              argColumnID: dao.Column;)
      }
  }
  </code></pre>
  
  <p><strong>Other file (in other solution)</strong>:</p>
  
  <pre><code>public class myObject {
                      public int someOtherID { get; private set;}
                      public int? ColumnID { get; private set;}
  
                      public myObject(int someOtherID, int? argColumnID);
                                                  {
                                                      someOtherID = argsomeOtherID;
                                                      ColumnID = argColumnID;
                                                  }
                        }
  </code></pre>
  
  <p>(namespace <strong>DataAccess) Table.cs</strong>:</p>
  
  <pre><code>public partial class DBTable
      {
          public int ID { get; set; }        
          public int someOtherID { get; set; }
  
          public virtual Column Column { get; set; }
      }
  }
  </code></pre>