I am returning IQueryable<Customer>
to the other method for some querying operations. The return method looks like:
return from cust in _dbCustList
select new Customer
{
CustomerId = cust.Customer_Id,
FirstName= cust.First_Name,
LastName= cust.Last_Name,
DOB= cust.Date_Of_Birth,
LoginTime = cust.Login_Time ?? new TimeSpan(0, 0, 0);
};
In the above result, cust.Login_Time
is nullable property.
When i try to query the above result, it throws an error:
Method 'System.TimeSpan GetTimeSpan(System.Nullable`1[System.TimeSpan])' has no supported translation to SQL.
How to solve this error?