ASP.NET MVC - “Every derived table must have its own alias”

kansas

New Member
I'm working on a book library website and have the following code:\[code\]repository = new Repository(db);Copy copy = repository.GetCopies().Single(c => c.id == copyId);copy.loaner = loanerId; db.copies.Attach(copy);db.ObjectStateManager.ChangeObjectState(copy, EntityState.Modified);db.SaveChanges();\[/code\]When I reach the last line I get the following error:\[quote\] Every derived table must have its own alias\[/quote\]I have no idea what is wrong
 
Back
Top