I have 3 tables:
*USERS*
ID | USERNAME | ...
*SERVICE_NAME*
ID | SERVICE_NAME
*USER_SERVICES*
ID | ID_USER | ID_SERVICE
From the table *USER_SERVICES*
, I can check if the user has the services enabled.
This is my LINQ so far but it returns me only users who have actually at least one service enabled.
var resultsServices = from p in USER_SERVICES
group p.ID_SERVICE by p.ID_USER into g
select new { ID_USER = g.Key, Services = g.ToList() };
users = (from user in USERS
join service in resultsServices on user.ID equals service.ID_USER
where user.ID == service.ID_USER
select new
{
user,
service.Services
});
How can I return all users, even if they do not have any service enabled that it "return null" or something?