この方法でEFを使用して2つのテーブルデータを取得し、それをリストに変換してビューに渡します.mvc4で作業していますが、このエラーが発生しています:
Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<EFwithMVC.Models.dc_tp_personnel>' to 'System.Collections.Generic.List<EFwithMVC.Models.bc_limsEntities>' C:\Users\Administrator\Documents\Visual Studio 2010\Projects\EFwithMVC\EFwithMVC\Controllers\PersonellController.cs 119 34 EFwithMVC
これが私のコードです:
public List<bc_limsEntities> GetTwoTableData()
{
using (var db = new bc_limsEntities())
{
return (from x in db.dc_tp_personnel.Include("dc_toutside_test")
where x.PersonId == 1
select x).ToList();
}
}
親切に私を助けてください、なぜこのエラーが来るのかわかりません