title: Transforming Linq To Sql DataContext objects to DataContract objects
body: <p>I have DataContext classes generated from dbml. Once I get data from the database, I need to transform them into DataContract classes so that the objects can be sent via WCF.</p>
  
  <p>One way to do this is like this:</p>
  
  <pre><code>using (var dc = new TestDBL2SDataContext(Settings.Default.TestDBConnectionString))
          {
              var myEmp = from rec in dc.Employees
                      select new MyDataContracts.Employee 
                               { 
                                 FirstName = rec.Name.Substring(0,10) 
                               };
              return myEmp.FirstOrDefault();;
          }
  </code></pre>
  
  <p>Is there a better way to do this via an XSD/XSLT file that I can  define in my project and simply point to ?</p>