I am trying to get the first and last values in a list. The query operator First() is supported but Last() and LastOrDefault() give an
Last is not supported by the back-end DB. You should try other techniques:
Run your query using OrderByDescending so your requested item comes first.
Code your LINQ query as usual, but enforce Linq2Sql to render it to a CLR collection and then you'll have free access to everything locally, including Last. Example:
var bills = purchaseBills.ToList();
var last = bills.Last();