net と私は .net でアプリケーションを開発しています。
次のエラーが表示され、コードの何が問題なのかわかりません
LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
これは、例外が発生する私のコードです。
public List<ToureDeieselBean> loadDeiselListOnTourUpDownId(int tourUpDownId)
{
return (from p in context.tb_tourDiesel
where p.deleted == 0
where p.tourUpDownId == tourUpDownId
select new ToureDeieselBean
{
id = p.id,
qty =(float)p.qty,
ratePerlt = (float)p.ratePerlt,
createdBy = p.createdBy,
createdOn = p.createdOn==null?"":(p.createdOn).ToString(),
updatedBy = p.updatedBy,
updatedOn = p.updatedOn == null ? "" :(p.updatedOn).ToString(),
descrption=p.descrption,
deleted=Convert.ToBoolean(p.deleted)
}).ToList<ToureDeieselBean>();
}