Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
sqlquery:

select[FullName],[UserId]
from[UserTranslate] where[UserId] in
(select[User].Id

from[dbo].[UserRole]
inner join[Role]
on[UserRole].RoleId=[Role].Id

inner join[User]
on[User].Id=[User].Id
Where[UserRole].OrganisationId in (select OrganisationId from Activity where ActivityId = 1)

and[Role].Name in ('Activitymanager','Sessionorganiser','Provideradmin')
) and LanguageId = 1
Posted
Comments
SMwebdeveloper2 14-Sep-15 5:59am    
The follwing is in correct
linq query
Thanks7872 14-Sep-15 6:46am    
We don't have such tools. You have to learn linq and write it.

1 solution

(from UserTran in _healthpassDataContext.UserTranslates
join temp in (

(from a in _healthpassDataContext.UserRoles
join s in _healthpassDataContext.Users on a.UserId equals s.Id
where (a.OrganisationId == (from act in _healthpassDataContext.Activities where (act.ActivityId == activityId) select new { OrganisationId = act.OrganisationId }).FirstOrDefault().OrganisationId)
join s1 in _healthpassDataContext.Roles on a.RoleId equals s1.Id
where UserRoleList.Contains(s1.Name)
select new { UserId = s.Id }))
on UserTran.UserId equals temp.UserId
where (UserTran.LanguageId == languageId)
select new { UserId = UserTran.UserId, FullName = UserTran.FullName }).AsQueryable()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900