EF is a ORM. Its main goal is to map sql tables to objects, and objects to sql tables. This requires that you map all the tables to sets in the database context and defines the keys. once this is done, you can do linq queries.
assume you defined the dbcontext and sets its:
var rows = db.Clients
.Join(db.ClientsServiceCodes,
c => c.ClientId,
csc => csc.ClientId,
(c, csc) => new { c, csc}
)
.Join(db.ClientsAccessLevels,
j1 => j1.c.ClientId,
cal => cal.ClientId,
(j1, cal) => new { j1.c, j1.csc, cal}
)
.Where(j2 => j2.csc.Dept == "2" && j2.cal.AccessLevel == "2")
.GroupBy(j2 => new {j2.c.ClientId, j2.c.First, j2.c.Last})
.Select(g => new {g.ClientId, g.First, g.Last, Count = g.Count()})
.OrderBy(r => r.Last)
.ToList();
if you like coding in sql, look at dapper, which just maps queries to objects: