Hi!
I have the problem with running HierarchyID support in my MVC5 project. :(
This part of code throws System.NotSupportedException exception.
(The specified type member 'PathId' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.)
Thank you for your help.
Jiri
I have the problem with running HierarchyID support in my MVC5 project. :(
This part of code throws System.NotSupportedException exception.
(The specified type member 'PathId' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported.)
public ActionResult Index()
{
var items = db.Categories.OrderByDescending(o => o.PathId).ToArray();
return View(items);
}
Definition in edmx file:namespace Administration.Models
{
using System;
using System.Collections.Generic;
using System.Data.Entity.Hierarchy;
public partial class Category
{
public Category()
{
this.CategoriesParameters = new HashSet<CategoriesParameter>();
this.Products = new HashSet<Product>();
}
public int Id { get; set; }
public HierarchyId PathId { get; set; }
public string PageTitle { get; set; }
public string PageDescription { get; set; }
public string PageKeywords { get; set; }
public string Name { get; set; }
public string Culture { get; set; }
public bool IsEnabled { get; set; }
public virtual ICollection<CategoriesParameter> CategoriesParameters { get; set; }
public virtual ICollection<Product> Products { get; set; }
}
}
Installed: EntityFramework.HierarchyId 6.1.0-pre3Thank you for your help.
Jiri