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

  • SEARCH
  • Home
  • 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 6193955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:12:43+00:00 2026-05-24T03:12:43+00:00

i got this error… LINQ to Entities does not recognize the method ‘Int64 GetPostsCountQuery(Int64)’

  • 0

i got this error…

LINQ to Entities does not recognize the method ‘Int64 GetPostsCountQuery(Int64)’ method, and this method cannot be translated into a store expression.

here my code:

    private Blog GetBlogDetailsByUserId(long userId)
    {
        return (from gs in _entities.wu_Blog_General_Settings
                //join p in _entities.wu_Blog_Post on gs.User_Id equals p.User_Id
                let pCount = GetPostsCountQuery(userId)
                let lastPublish = GetPostsLastPublishedQuery(userId, pCount)
                where gs.User_Id == userId && !gs.Is_Deleted
                select new Blog
                {
                    BlogOwnerUserId = userId,
                    BlogTitle = gs.Blog_Title,
                    BlogDescription = gs.Blog_Description,
                    PostsCount = pCount,
                    LastPublishedDate = lastPublish
                }).SingleOrDefault();
    }
    #endregion

    #region Get Posts Count Query
    private long GetPostsCountQuery(long userId)
    {
        return (from p in _entities.wu_Blog_Post
                where p.User_Id == userId && p.Post_State != (int)PostState.Removed &&
                !p.Is_Deleted
                select p).Count();
    }
    #endregion
  • 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-24T03:12:44+00:00Added an answer on May 24, 2026 at 3:12 am

    You cannot use .NET method in Linq-to-entities because EF is not able to translate them to SQL (the provider doesn’t explore their content).

    The only .NET method allowed in linq-to-entities are either:

    • Connonical methods translated to SQL by EF automatically
    • Mapped SQL functions or custom SQL operations
    • Model defined functions
    • some extension methods running on IQueryable and returning IQueryable
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error message and I'm not quite sure whats wrong: Exception in
I got this error message Connection - Could not find SBO that match the
I got this error: Could not find gem 'mysql2 (>= 0, runtime)' in any
Got this error whenever I try to compile something: F1027 Unit not found: 'System.pas'
Got this error for the first time, I have looked around and cannot find
When trying to do the watershed method i got this error: Unsupported format or
I got this error Cannot access a closed file when I save more than
Using linq and silverlight got this error....I am using POCO....DTO = POCO public IEnumerable.....
I got this error today when trying to open a Visual Studio 2008 project
I got this error when I tried to compile an application that includes the

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.