Home:ALL Converter>MySQL in MVC 3: Specified method is not supported

MySQL in MVC 3: Specified method is not supported

Ask Time:2012-05-15T05:13:40         Author:Tony

Json Formatter

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();

Author:Tony,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/10591159/mysql-in-mvc-3-specified-method-is-not-supported
yy