0
je le code suivant d'abord entité -expression Lambda pour correspondre à la propriété de navigation ICollection avec un tableau
public class Contact
{
public Contact()
{
this.Tags = new HashSet<Tag>();
}
public int ContactId { get; set; }
public string ContactName { get; set; }
public virtual ICollection<Tag> Tags { get; set; }
}
public class Tag
{
public Tag()
{
this.Contacts = new HashSet<Contact>();
}
public int TagId { get; set; }
public string TagName { get; set; }
public virtual ICollection<Contact> Contacts { get; set; }
}
Je voudrais rechercher un contact basé sur la propriété Mots clés à partir d'un tableau de chaînes. Quelque chose comme le suivant-
//string[] tags
Select from Db.Contacts where any Tag matched with any item in arrTags
Je ne pouvais pas comprendre comment cela peut être fait en lambda. De l'aide?
Il sélectionne Liste. Mais je dois sélectionner la liste . –
@ s.k.paul voir la réponse mise à jour. –