net and i am developing an application in .net.
I am getting the following error and i don't know what is wrong with my code
LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression.
This is my code where exception is coming.
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>();
}