title: Nested Data Contract Exception in WCF - Cannot Implicitly convert Entity's model to model defined in DataContract
body: <p><strong>Problem Statement:</strong></p>
  
  <p>In my MVC 4 application,I have an index view(List View) where I'm bringing data from multiple tables. I'm able to bind the data to grid and fetch values.Now I'm converting the method involved in fetching the data from MVC controller to WCF method,where I'm facing problems in conversion which I am able to do with my controller code.Following is the code that I have been using:</p>
  
  <p><strong>Working Code:</strong></p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>public ActionResult Index()
  {
      var result = GetIndexData();
      return PartialView(result);
  }
  
  public IEnumerable&lt;GlobalUpgradeModel&gt; GetIndexData()
  {
      return (from u in db.Upgrade.AsEnumerable()
              join a in db.Asset.AsEnumerable() on u.ID equals a.ID
              where a.AssetID == u.AssetID
              orderby u.AssetID
              select new GlobalModel()
              {
                  assetModel = a,
                  upgradeModel = u
              }).Distinct().ToList();
  }
  
  public class GlobalModel
  {
      public UpgradeModel upgradeModel { get; set; }
  
      public AssetModel assetModel { get; set; }
  }
  </code></pre>
  
  <p>Here I'm able to get and bind data from model to view.Everything is working fine.</p>
  
  <p><strong>Now I have converted this to WCF:</strong></p>
  
  <p><strong>IService1.cs:</strong></p>
  
  <pre><code>[OperationContract]
  [WebInvoke(Method = "GET", UriTemplate = "/GetUpgradeIndexData")]
  IEnumerable&lt;GlobalUpgradeDC&gt; GetUpgradeIndexData();
  
  [DataContract]
  public class UpgradeDC
  {
      [DataMember]
      public int AssetID { get; set; }
  
      [DataMember]
      public long SlNo { get; set; }
  
      [DataMember]
      public string UpgradeDetails{ get; set; }
  }
  
  [DataContract]
  public class AssetDC
  {
      [DataMember]
      public int AssetID { get; set; }
  
      [DataMember]
      public string AssetDescrip { get; set; }
  }
  
  [DataContract]
  public class GlobalUpgradeDC
  {
      [DataMember]
      public AssetDC assetDC { get; set; }
  
      [DataMember]
      public UpgradeDC upgradeDC { get; set; }
  }
  </code></pre>
  
  <p><strong>Service1.svc:</strong></p>
  
  <pre><code>public IEnumerable&lt;GlobalUpgradeDC&gt; GetUpgradeIndexData()
  {
      return (from u in dbEntity.UpgradeDetails.AsEnumerable()
              join a in dbEntity.AssetTaggings.AsEnumerable() on u.TenantID equals a.TenantID
              where a.AssetID == u.AssetID
              orderby u.AssetID
              select new GlobalUpgradeDC()
              {
                  assetDC = a,
                  upgradeDC = u
  
                  //Here I'm getting error as Cannot Implicitly Convert type from Entities model to Model of data contract
              }).ToList();
  }
  </code></pre>
  
  <p>What i'm doing wrong?</p>