I am using Lambda expression for Where Clause with Join. Here is my query
var ActiveImages = db.tbl_Advertise
.Where(i => i.IsVisible == true)
.Join(db.tbl_ShopMast.Where(i => i.IsVisible == true && i.fk_userID == userid),
i => i.fk_shop_id,
j => j.ShopID,
(i, j) => new { Advertise = i, Shop = j})
.ToList();
or I can even right this query as :
var ActiveImages = db.tbl_Advertise
.Join(db.tbl_ShopMast.Where(i => i.IsVisible == true && i.fk_userID == userid),
i => i.fk_shop_id,
j => j.ShopID,
(i, j) => new { Advertise = i, Shop = j})
.ToList()
.Where(i=>i.Advertise.IsVisible == true);
Which one works faster? Although I have noticed both giving same output, but which way is correct?