Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6780341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:29:40+00:00 2026-05-26T16:29:40+00:00

I am getting the error : LINQ to Entities does not recognize the method

  • 0

I am getting the error :

LINQ to Entities does not recognize the method ‘PagedList.IPagedList1[MvcMusicStore.Models.Album] ToPagedList[Album](System.Collections.Generic.IEnumerable1[MvcMusicStore.Models.Album], Int32, Int32)’ method, and this method cannot be translated into a store expression

For my following controller action :

    public ActionResult Browse(string genre, int?page)
    {
        // Retrieve Genre and its Associated Albums from database
        int pageIndex = page ?? 1;
        var genreModel = storeDB.Genres.Where(g => g.Name == genre)
                                       .Select(g => new GenreAlbumView
                                       {
                                           ID = g.GenreId,
                                           Name = g.Name,
                                           Albums = g.Albums.ToPagedList(pageIndex, PageSize)
                                       }).SingleOrDefault();
        return View(genreModel);
    }

What can be the reason and solution to this problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:29:41+00:00Added an answer on May 26, 2026 at 4:29 pm

    First run your genermodel query:

    var genreModel = storeDB.Genres.Where(g => g.Name == genre).SingleOrDefault();
    

    Then run your select.

    Because lin2entity has limited functionality support and can’t convert your function:

    g.Albums.ToPagedList(pageIndex, PageSize)
    

    to appropriated sql command, in fact it can’t create related expression tree for it, so you should first get entities and then select as a way you want.

    If you should do such a paging in DB, create a stored procedure and use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why I am getting this error: The method 'Single' is not supported by LINQ
I'm getting a timeout error when trying to execute a LINQ (-to-SQL) query System.Data.SqlClient.SqlException:
I'm getting the error: Line 49: xml = r.ReadToEnd(); Line 50: Line 51: System.Xml.Linq.XDocument
I am getting an error when trying to use linqsql query: LINQ to Entities
I am getting this error when I use the Linq expression of var emp
I am trying to update code via Linq, but I am getting this error:
at the moment im loading xml and i am getting error: System.Xml.XmlException: ' ',
I am getting this error while creating a public method on a class for
I am getting an error returning a linq query over http to an ASP.Net
I keep getting this error when making the program as given below: using System;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.