The member [class] has no supported translation to SQL
- by Code Sherpa
Hi, I am getting the following error:
Error Message:The member
'Company.ProductCore.Core.Domain.Account.Email'
has no supported translation to SQL.
My method looks like this:
public Account GetAccountByEmail(string email)
{
Account account;
using (WorkbookDataContext dc = _conn.GetContext())
{
account = ( from a in dc.Accounts
join em in dc.Emails on a.AccountId equals em.AccountId
where a.Email.EmailAddress == email
select a).FirstOrDefault();
}
return account;
}
My Account class has a getter / setter that exposes Email:
public Email Email
{
get { return _email; }
set { _email = value; }
}
And my Email is a LINQ object.
I have a feeling that the problem is that I am using a LINQ object for me Email
property? I am new to LINQ and am not really sure why this is happening.
Help appreciated, thanks...