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 7953801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:14:26+00:00 2026-06-04T03:14:26+00:00

in my MVC 3 project I’m usint the MySQL connector. When I try to

  • 0

in my MVC 3 project I’m usint the MySQL connector. When I try to invoke that method, I get the Specified method is not supported error. Why ?

    public IList<Order> GetOrders()
    {
        return (from x in db.Order 
                where (x.Address.FirstOrDefault() != null) 
                orderby x.Created //it's a DateTime
                descending select x).ToList(); 
    }

edit

I see there’s a problem with the x.Address.FirstOrDefault() != null

edit2

That code also works

return (from x in db.Order
             from y in db.Address
             where (y.OrderID == x.OrderID)
        orderby x.Created descending
        select x).ToList();
  • 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-06-04T03:14:27+00:00Added an answer on June 4, 2026 at 3:14 am

    With some ORM tools, not all of the LINQ methods are supported out of the box. I know I have had that exact message using NHibernate in the past. In order to achieve this you’ll have to rewrite your logic to use more traditional methods. Try this:

    return (from x in db.Order 
                where x.Address.Count() > 0 
                orderby x.Created //it's a DateTime
                descending select x).ToList();
    

    Or if for some reason you don’t like the above, your other alternative is to first bring the collection in memory by resolving it, then perform your logic (although bear in mind this will be slower as it’s bringing more data back from the database):

    return (from x in db.Order
                orderby x.Created //it's a DateTime
                descending select x)
           .ToList() //resolve the query, now work with it in memory from here
           .Where(x => x.Address.FirstOrDefault() != null)
           .ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC project that provides (GET) & consumes (PUT) a Json object.
Our current MVC project is set up to have ViewModels that encapsulate the data
I have an MVC project that I would like to write in .NET 4.0
If my MVC project is referencing (regular project reference not service reference) a WCF
In my ASP.NET MVC project, my actions typically call a Service layer to get
I have a MVC project that has a Linq to SQL dbml class. It
My first .Net/MVC project, I generated a view that allows me to list, edit,
In my ASP.NET MVC project, I have a polymorphic collection that I wish to
With a PHP MVC project, I have a few model classes that load data
I have a MVC project that uses foo.dll, but that foo.dll uses smu.dll so

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.