I got two lists, a lists of facebooks, and a list of users.
The facebook object gets only a property, id, like:
public class EFacebook
{
public string id { get; set; }
}
The second list is a list of users, but the object is more complex, each user gets a nullable list of providers inside, one of these providers can be a facebook one, and each provider gets a id, like:
public class EUser
{
public List<EProvider> EProviders { get; set; }
}
public class EProvider
{
public enum EnumProviderType
{
Facebook = 2,
Twitter = 3
}
public EnumProviderType ProviderType { get; set; }
public string Id { get; set; }
}
I need to filter the facebook list based on the users providers, getting two children lists, users that are facebooks and users that are not facebooks. I'm trying something like:
var query1 =
from i in users
where i.EProviders.Any(j => j.ProviderType == EProvider.EnumProviderType.Facebook)
select i.EProviders;
var query =
from i in facebooks
where i.id.Equals(???)
select i;