2014-04-15 45 views
0
public List<class> method() 
      { 
      return _context.OffshoreTransactions.Select (x => new OffshoreTransactionRecord 
      { 
       CheckNumber = x.CheckNumber, 
       Comment = x.Comment, 
       Description = x.Description, 
       TransactionAmount = x.Amount, 
       TransactionId = x.TransactionTypeId, 
       Upload = x.UploadFile, 
       Id = x.Id 

      }).ToList(); 
      } 

無法在LINQ to Entities查詢中構造實體或複雜類型「XXX」。無法在LINQ to Entities查詢中構造實體或複雜類型'EmployeeStoreModel.karthiktable'

+0

我能在我的情況下獲得的記錄在這裏的上述問題 – Karthik

+0

是的,我明白了感謝 – Karthik

回答

1
using (context) 
      { 
       // Get all constructed type product and then select from it 
       var subcate = context.karthiktables 
       .ToList() 
       .Select(x => new karthiktable 
       { 
        name = x.name, 
        F_name = x.F_name, 
        L_name = x.L_name, 
        Address = x.Address, 
        T_Address = x.T_Address, 
        Id = x.Id 
       }); 

       return subcate; 
+0

謝謝你,我得到了它,但就是兩人之間的差別我得到的結果,從您的文章 – Karthik

相關問題