linq query - The method or operation is not implemented.

Posted by Dejan.S on Stack Overflow See other posts from Stack Overflow or by Dejan.S
Published on 2010-05-30T10:40:53Z Indexed on 2010/05/30 10:42 UTC
Read the original article Hit count: 533

Filed under:
|
|

I'm doing the Rob Conery mvc storefront and at one place I'm suppose to get categories but I get an error with this linq query and I can not get why. It's exactly the same as his.

var culturedName = from ct in ReadOnlyContext.CategoryCultureDetails
                           where ct.Culture.LanguageCode == System.Globalization.CultureInfo.CurrentUICulture.TwoLetterISOLanguageName
                           select new
                           {
                               ct.CategoryName,
                               ct.CategoryId
                           };

        return from c in ReadOnlyContext.Categories
               join cn in culturedName on c.CategoryId equals cn.CategoryId
               select new Core.Model.Category
               {
                   Id = c.CategoryId,
                   Name = cn.CategoryName,
                   ParentId = c.ParentId ?? 0,
                   Products = new LazyList<Core.Model.Product>(from p in GetProducts()
                                                               join cp in ReadOnlyContext.Categories_Products on p.Id equals cp.ProductId
                                                               where cp.CategoryId == c.CategoryId
                                                               select p)
               };

its the return query that mess things up. I have checked and the culturename actually gets data from the database. Appricate your help

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about LINQ