Hi, All.
I have SQL-request:
select FullName, CreatedBy, CreatedOn, DomainName, ModifiedBy from SystemUser
where SystemUserId In (
SELECT SystemUserId
FROM [UserSettings]
where [TimeZoneBias] != -60
and [TimeZoneCode] != 110)
and IsDisabled = 0
I need to convert this request into LINQ.
I wrote this (this is my first LINQ-request):
from s in SystemUserSet
where s.SystemUserId.Contains
(from sy in UserSettingsSet
where sy.TimeZoneBias != -60 && sy.TimeZoneCode != 110
select sy.SystemUserId)
&& s.IsDisabled = 0
select s
And I get error:
'System.Guid?' does not contain a definition for 'Contains' and the best extension method overload 'System.Linq.Queryable.Contains(System.Linq.IQueryable, TSource)' has some invalid arguments
Instance argument: cannot convert from 'System.Guid?' to 'System.Linq.IQueryable>'
Please, could you help with convert?
Thanks!
22 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Kailash PolaiPosted Jul 9, 2015, 4:45 AM
join q in db.UserSettings on p.SystemUserId equals q.SystemUserId
where q.TimeZoneBias != -60 && q.TimeZoneCode != 110 && p.IsDisabled == false
select new
{
}).ToList();
Ankit ShuklaPosted Jul 7, 2015, 9:47 AM
NatalijaPosted Jun 16, 2015, 6:22 AM
Khan Abrar AhmedPosted Jun 16, 2015, 5:53 AM
NatalijaPosted Jun 16, 2015, 5:48 AM
Khan Abrar AhmedPosted Jun 16, 2015, 5:43 AM
join m in UserSettings on o.SystemUserId equals m.SystemUserId
where m.TimeZoneBias != -60 && Convert.ToInt32(m.TimeZoneCode) != Convert.ToInt32(110)
&& o.IsDisabled ==false
select o;
NatalijaPosted Jun 16, 2015, 5:39 AM
Khan Abrar AhmedPosted Jun 16, 2015, 5:30 AM
NatalijaPosted Jun 16, 2015, 5:28 AM
Khan Abrar AhmedPosted Jun 16, 2015, 5:17 AM
join m in UserSettings on o.SystemUserId equals m.SystemUserId
where m.TimeZoneBias != -60 && Convert.ToInt32(m.TimeZoneCode) != Convert.ToInt32(110)
&& o.IsDisabled ==false
select o;
NatalijaPosted Jun 16, 2015, 5:13 AM
NatalijaPosted Jun 16, 2015, 5:09 AM
Khan Abrar AhmedPosted Jun 16, 2015, 5:06 AM
join m in UserSettings on o.SystemUserId equals m.SystemUserId
where m.TimeZoneBias != -60 && m.TimeZoneCode != 110
&& o.IsDisabled ==false
select o;
Sabyasachi MishraPosted Jun 16, 2015, 4:53 AM
NatalijaPosted Jun 16, 2015, 4:53 AM
NatalijaPosted Jun 16, 2015, 4:50 AM
Khan Abrar AhmedPosted Jun 16, 2015, 4:49 AM
Abrar Ahmad AnsariPosted Jun 16, 2015, 4:48 AM
where sy.TimeZoneBias != -60 && sy.TimeZoneCode != 110
select sy.SystemUserId).ToList();
where SystemUserId.Contains(s.SystemUserId)
&& s.IsDisabled == 0
NatalijaPosted Jun 16, 2015, 4:48 AM
NatalijaPosted Jun 16, 2015, 4:44 AM
Sabyasachi MishraPosted Jun 16, 2015, 4:41 AM
Khan Abrar AhmedPosted Jun 16, 2015, 4:38 AM
join m in UserSettings on o.SystemUserId equals m.SystemUserId
where m.TimeZoneBias != -60 && m.TimeZoneCode != 110
&& o.IsDisabled =0
select o;