LINQ to SQLで動作するクエリがあります。私はそれをLINQ to Entitiesに変換する必要があります。私はそれが私がエラーを取得するあるとしてそれを使用LINQ to Entitiesサブクエリ
(from pr in Products
join c in Categories on pr.CategoryID equals c.CategoryID
join b in Colors on pr.ColorID equals b.ColorID
select new{
ProductID = pr.ProductID,
Manufacturer = pr.Manufacturer.Name,
Model = v.Model.ModelName,
Category = c.Name,
Photos = from p in Photos where pr.ProductID == p.ProductID select p
}).FirstOrDefault()
:
Unable to create a constant value of type Only primitive types ('such as Int32, String, and Guid') are supported in this context.
問題は、この部分にある:あなたのための関連クエリを自動管理し
Photos = from p in Photos where pr.ProductID == p.ProductID select p