【发布时间】:2020-05-11 07:36:46
【问题描述】:
我一直在尝试提高 C# .NET Core 2.2 应用程序上多个包含语句的性能。关于如何改进此语句的任何建议?
private static void IncludeAssociatedEntities(ref IQueryable<Person> query)
{
query = query.Include(p => p.Contact);
query = query.Include(p => p.PersonAddressAssociations);
query = query.Include(p => p.PersonCorePropertyAssociations);
query = query.Include(p => p.PersonAssociations).ThenInclude(a => a.ParentPerson);
query = query.Include(p => p.PersonPhones);
query = query.Include(p => p.PersonOrganizationAssociations);
query = query.Include(p => p.PersonProjectAssociations);
}
【问题讨论】:
-
您到底在尝试什么?避免我们(和您自己)提出相同的建议。
标签: c# .net-core frameworks entity ef-core-2.2