title: Convert 1 class to another class with same fields
body: <p>Lets say i have 2 classes ( one from them comes from my entity framework and the other is global and its available in the entire application while EF one isnt) They both have the same properties and fields. Is there a easier and faster way to cast the Entity class to the global class other than that example?</p>
  
  <p>Global one:</p>
  
  <pre><code> public class CompanyOwner
  {
      public Guid OwnerId { get; set; }
      public string CompanyName { get; set; }
      public string Address { get; set; }
      public string Phone { get; set; }
      public string Email { get; set; }
  }
  </code></pre>
  
  <p>Entity model class</p>
  
  <pre><code> public class dbOwner
  {
      public Guid OwnerId { get; set; }
      public string CompanyName { get; set; }
      public string Address { get; set; }
      public string Phone { get; set; }
      public string Email { get; set; }
  }
  </code></pre>
  
  <p>The way im doing it right now:</p>
  
  <pre><code>        CompanyOwner owner = new CompanyOwner();  
          Owner dbOwner = entities.FirstOrDefault(.....)// some LINQ
          owner.CompanyName = dbOwner.CompanyName;
          owner.Address = dbOwner.Address;
          owner.Email = dbOwner.Email;
          owner.Phone = dbOwner.Phone;
  </code></pre>