Include several references on the second level

前端 未结 2 648
广开言路
广开言路 2020-12-23 10:53

Assume we have this model :

public class Tiers
{
    public List Contacts { get; set; }
}

and

public class C         


        
2条回答
  •  悲哀的现实
    2020-12-23 11:36

    For completeness' sake:

    It is also possible to include nested properties directly via Include in case they are not collection properties like so:

    _dbSet
        .Include(tier => tier.Contact.Titre)
        .Include(tier => tier.Contact.TypeContact)
        .Include(tier => tier.Contact.Langue);
    

提交回复
热议问题