Skip to content

Why I'm getting Lambda expression used inside Include is not valid. #6

Description

@aqkbm

Hi can any one just correct me the error occur when running the grid values using this below code:

Error: "An unhandled exception occurred while processing the request.
InvalidOperationException: Lambda expression used inside Include is not valid."

code: public IEnumerable GetAll()
{
return _context.LibraryAssets
.Include(asset => asset.Status)
.Include(asset => asset.Location);
}

in view side:

@foreach (var asset in Model.Assets) {

@asset.Title @asset.AuthorOrDirector @asset.DeweyCallNumber }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions