Reputation: 47945
I have this code:
Strutture = from Ricettivito s in Strutture
where s.ServiziAttivi.Cast<string>().Intersect(IDSServizi).Count() == IDSServizi.Count()
select s;
I need to:
But seems I cannot doint that conversion?
Upvotes: 0
Views: 100
Reputation: 35353
First cast to .Cast<Ricettivita.MyService>()
then select a string property.
where s.ServiziAttivi
.Cast<Ricettivita.MyService>()
.Select(x=>x.UniqueID).Intersect(IDSServizi).Count()
Upvotes: 4
Reputation: 125630
I think you should use Select
instead of Cast
:
Strutture = from Ricettivito s in Strutture
where s.ServiziAttivi.Select(x => (string)x.UniqueID).Intersect(IDSServizi).Count() == IDSServizi.Count()
select s;
Upvotes: 1