what’s the problem with this ?
int folderid = (from p in db.folder where p.isDefault == true select p.id).Last();
i get this error
LINQ to Entities does not recognize the method 'Int32 Last[Int32]
(System.Linq.IQueryable`1[System.Int32])' method, and this method cannot be
translated into a store expression.
Linq can not translate the
Last()to any valid sql statment. So my suggestion would be toorderby decendingandTake(1)Maybe something like this:
I don’t know which to take so you might have to change the
orderby p.id descendingto something that suites you.