I am using Entity Framework with ASP.NET 4.0. This is a simple problem where i have to hide a Install button for all gadgets already installed by my user. I am using repeater for the databinding and UI generation.
Database schema is as below
Apps
----------
AppId
Appname
Description
Applications installed for a user will be added to below table
InstalledApps
------------
Rid
UserId
AppId
so entity ends up like this
Users
Apps
InstalledApps
I would want entity framework equivalent of below SQL
SELECT AppId,AppName,Description FROM Apps WHERE Apps.AppId NOT IN (SELECT AppId FROM InstalledApps WHERE UserId = 1)
note: If there is more simple query that would yield same result i would love to know. This just popped out of my head