i am new to linq and having a hard time to implement searching using two table , i have a sql server stored procedure that is working fine , but i want to do it with linq and its both are looking very different can not able to implement count of user and Contains Properly , can anyone help me on this here is my sql to which i am trying to implement in linq
@pTeamName Varchar (25) = 'ALL',
@pUserFirstName Varchar (25) = 'ALL'
select
t.TeamId,TeamName,[Description],
COUNT(u.UserId)as UserCount from Team t
left outer join [User] u on u.TeamId=t.TeamId
WHERE
(t.TeamName Like '%'+@pTeamName+'%' OR @pTeamName Like 'ALL')
AND (u.FirstName = @pUserFirstName OR @pUserFirstName Like 'ALL')
AND t.Deleted = 0
group by
TeamName,
[Description],
t.TeamId
and here is my linq what i have so far
from t in Teams
join u in Users on t.TeamId equals u.TeamId
where t.TeamName.Contains("Tester")
select new {t.TeamName,t.Description,u.UserId}