I have the following SQL query, note I want the literal value '0' in the second field in the second SELECT statement from the ItemSale table. How do I express this in LINQ? I get the error message 'Invalid anonymous type member declarator'.
SELECT BranchNumber,QuantitySold
FROM Department
UNION
SELECT BranchNumber,0
FROM ItemSale
How to express the '0' in LINQ?
var unionQuery = (from dept in Department
select new
{
dept.BranchNumber,
dept.QuantitySold,
})
.Concat(from item in ItemSale
select new
{
item.BranchNumber,
0
});