请参阅以下代码:
Public Function GetBook(ByVal ISBN As Integer) As Book Implements IBookDAO.GetBook
Using context = New LibraryDBEntities()
'Dim bookDetails = context.BookEntities.Where(Function(b) b.ISBN = ISBN)
Dim bookDetails = context.BookEntities.Where(Function(b) b.ISBN = ISBN)
Dim details = Mapper.Map(Of BookEntity, Book)(bookDetails)
Return details
End Using
End Function
我得到的错误是:“{”无法将类型为'System.Data.Entity.Infrastructure.DbQuery`1 [DataObjects.BookEntity]'的对象强制转换为'DataObjects.BookEntity'。“}”我是什么做错了?