I’m adding some properties to my partial classes created by the L2S generator.
I’m trying to create an “Available” Boolean property based on 2 other properties. “Enabled” and “Confirmed”
I did simply have
public Boolean Available
{
get
{
return (Enabled && Confirmed);
}
}
However when running this, it throws the “No translation to SQL” error.
How can I create this property without needing to always check “Enabled” and “Confirmed” when querying the data context?
Thanks
Ben
Make it to return an expression!
Please see: http://www.atrevido.net/blog/2007/09/05/Calling+Custom+Methods+In+LINQtoSQL.aspx
Also this post could be of help:
Method X has no supported translation to SQL – booleans and datetime