I'm new to MVC and its going well but struggling a bit with the back to front SQL etc
select * from aspnet_Users
where Active = 1 and UserId in (select UserId from aspnet_UsersInRoles,aspnet_Roles where aspnet_Roles.RoleId = aspnet_UsersInRoles.RoleId and aspnet_Roles.RoleName = 'Auth Level 1')
Tables and fields are:
aspnet_Users (UserId int, Active bit, eMail varchar)
aspnet_UsersInRoles (UserId, RoleId)
aspnet_Roles (RoleId int, RoleName varchar)
My attempt - but incomplete looks like this so far:
LmsDataContext db = new LmsDataContext();
var AuthUsers = from aspnet_User in db.aspnet_Users
join userinroles in db.aspnet_UsersInRoles on aspnet_User.UserId equals userinroles.UserId
where aspnet_User.Active
select aspnet_User;
Many thanks in advance