public InventorySales getinvSales(int mgrId, int SalesId)
{
Managerset res = null;
InventorySales invSales = (from x in sbdb.tblSalesn.where(i => i.salesId == Sid)
join y in sbdb.tblProds on x.salesid equals y.salesid into resSales
select new InventorySales()
{
ProductName = x.productname,
Location = (xyz!= null) ? xyz.location:string.empty,
Manager = (res != null) ? res.Manager : string.empty // error line
}).FirstOrDefault();
return invSales
}
That's how my code looks,
Manager = (res != null) ? res.Manager : string.empty
is causing an error, there is no relation between the tblManager and tblSales table