İki linq sorgum var. Bir sorgunun sonucunu başka bir sorguda kullanmak istiyorum.'Anonymous type' türünde sabit bir değer oluşturulamıyor
var t2s = (from temp3 in _ent.Products
where temp3.Row_Num == 2
select new { temp3.ProductID });
Sonra başka sorguda bu var kullanmak:
var _query = (from P1 in _ent.brands
join temp2 in on
new { Produ_ID = (Int32?)P1.Prod_ID }
equals new { Produ_ID = (Int32?)temp2.ProductID }
);
Ben kendisi tarafından ilk sorgu çalıştırdığınızda bana doğru sonucu verir. Ben join
olmadan ikinci birini çalıştırıyorsanız bana doğru sonucu verir ama bir join
ile bana aşağıdaki hatayı veriyor:
error: Unable to create a constant value of type 'Anonymous type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context
İkinci sorguda 't2s' nerede? –