EntityFrameworkQueryableExtensions.ThenInclude 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity,TPreviousProperty>, Expression<Func<TPreviousProperty,TProperty>>) |
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다. |
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>) |
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다. |
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity, ICollection<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>) |
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다. |
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity,TPreviousProperty>, Expression<Func<TPreviousProperty,TProperty>>)
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다.
public static Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,TProperty> ThenInclude<TEntity,TPreviousProperty,TProperty> (this Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,TPreviousProperty> source, System.Linq.Expressions.Expression<Func<TPreviousProperty,TProperty>> navigationPropertyPath) where TEntity : class;
static member ThenInclude : Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, 'PreviousProperty (requires 'Entity : null)> * System.Linq.Expressions.Expression<Func<'PreviousProperty, 'Property>> -> Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, 'Property (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ThenInclude(Of TEntity As Class, TPreviousProperty As Class, TProperty As Class) (source As IIncludableQueryable(Of TEntity, TPreviousProperty), navigationPropertyPath As Expression(Of Func(Of TPreviousProperty, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)
형식 매개 변수
- TEntity
쿼리할 엔터티의 형식입니다.
- TPreviousProperty
방금 포함된 엔터티의 형식입니다.
- TProperty
포함할 관련 엔터티의 형식입니다.
매개 변수
- source
- IIncludableQueryable<TEntity,TPreviousProperty>
원본 쿼리입니다.
- navigationPropertyPath
- Expression<Func<TPreviousProperty,TProperty>>
포함할 탐색 속성(t => t.Property1
)을 나타내는 람다 식입니다.
반환
관련 데이터가 포함된 새 쿼리입니다.
예제
다음 쿼리는 단일 수준의 관련 엔터티를 포함하는 것을 보여줍니다.
context.Blogs.Include(blog => blog.Posts)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다.
context.Blogs.Include(blog => blog.Posts).ThenInclude(post => post.Tags)
다음 쿼리는 관련 데이터의 여러 수준 및 분기를 포함하는 것을 보여 줍니다.
context.Blogs
.Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
.Include(blog => blog.Contributors)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다. 두 번째 엔터티는 파생 형식에 있습니다.
context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다. 두 번째 엔터티는 대체 메서드를 사용하여 파생 형식에 있는 것입니다.
context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags)
설명
자세한 내용 및 예제 는 관련 엔터티 로드 를 참조하세요.
적용 대상
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity, IEnumerable<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>)
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다.
public static Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,TProperty> ThenInclude<TEntity,TPreviousProperty,TProperty> (this Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,System.Collections.Generic.IEnumerable<TPreviousProperty>> source, System.Linq.Expressions.Expression<Func<TPreviousProperty,TProperty>> navigationPropertyPath) where TEntity : class;
static member ThenInclude : Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, seq<'PreviousProperty> (requires 'Entity : null)> * System.Linq.Expressions.Expression<Func<'PreviousProperty, 'Property>> -> Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, 'Property (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ThenInclude(Of TEntity As Class, TPreviousProperty As Class, TProperty As Class) (source As IIncludableQueryable(Of TEntity, IEnumerable(Of TPreviousProperty)), navigationPropertyPath As Expression(Of Func(Of TPreviousProperty, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)
형식 매개 변수
- TEntity
쿼리할 엔터티의 형식입니다.
- TPreviousProperty
방금 포함된 엔터티의 형식입니다.
- TProperty
포함할 관련 엔터티의 형식입니다.
매개 변수
- source
- IIncludableQueryable<TEntity,IEnumerable<TPreviousProperty>>
원본 쿼리입니다.
- navigationPropertyPath
- Expression<Func<TPreviousProperty,TProperty>>
포함할 탐색 속성(t => t.Property1
)을 나타내는 람다 식입니다.
반환
관련 데이터가 포함된 새 쿼리입니다.
예제
다음 쿼리는 단일 수준의 관련 엔터티를 포함하는 것을 보여줍니다.
context.Blogs.Include(blog => blog.Posts)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다.
context.Blogs
.Include(blog => blog.Posts).ThenInclude(post => post.Tags)
다음 쿼리는 관련 데이터의 여러 수준 및 분기를 포함하는 것을 보여 줍니다.
context.Blogs
.Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
.Include(blog => blog.Contributors)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다. 두 번째 엔터티는 캐스팅을 사용하여 파생 형식에 있는 것입니다.
context.Blogs.Include(blog => blog.Posts).ThenInclude(post => ((SpecialPost)post).SpecialTags)
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다. 두 번째 수준은 연산자를 as
사용하여 파생 형식에 있는 것입니다.
context.Blogs.Include(blog => blog.Posts).ThenInclude(post => (post as SpecialPost).SpecialTags)
설명
자세한 내용 및 예제 는 관련 엔터티 로드 를 참조하세요.
적용 대상
ThenInclude<TEntity,TPreviousProperty,TProperty>(IIncludableQueryable<TEntity, ICollection<TPreviousProperty>>, Expression<Func<TPreviousProperty, TProperty>>)
방금 포함된 관련 형식에 따라 추가로 포함할 추가 관련 데이터를 지정합니다.
public static Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,TProperty> ThenInclude<TEntity,TPreviousProperty,TProperty> (this Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<TEntity,System.Collections.Generic.ICollection<TPreviousProperty>> source, System.Linq.Expressions.Expression<Func<TPreviousProperty,TProperty>> navigationPropertyPath) where TEntity : class;
static member ThenInclude : Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, System.Collections.Generic.ICollection<'PreviousProperty> (requires 'Entity : null)> * System.Linq.Expressions.Expression<Func<'PreviousProperty, 'Property>> -> Microsoft.EntityFrameworkCore.Query.IIncludableQueryable<'Entity, 'Property (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ThenInclude(Of TEntity As Class, TPreviousProperty As Class, TProperty As Class) (source As IIncludableQueryable(Of TEntity, ICollection(Of TPreviousProperty)), navigationPropertyPath As Expression(Of Func(Of TPreviousProperty, TProperty))) As IIncludableQueryable(Of TEntity, TProperty)
형식 매개 변수
- TEntity
쿼리할 엔터티의 형식입니다.
- TPreviousProperty
방금 포함된 엔터티의 형식입니다.
- TProperty
포함할 관련 엔터티의 형식입니다.
매개 변수
- source
- IIncludableQueryable<TEntity,ICollection<TPreviousProperty>>
원본 쿼리입니다.
- navigationPropertyPath
- Expression<Func<TPreviousProperty,TProperty>>
포함할 탐색 속성(t => t.Property1
)을 나타내는 람다 식입니다.
반환
관련 데이터가 포함된 새 쿼리입니다.
예제
다음 쿼리는 단일 수준의 관련 엔터티를 포함하는 것을 보여줍니다.
context.Blogs.Include(blog => blog.Posts);
다음 쿼리는 동일한 분기에 두 개의 엔터티 수준을 포함하는 것을 보여 줍니다.
context.Blogs
.Include(blog => blog.Posts).ThenInclude(post => post.Tags);
다음 쿼리는 관련 데이터의 여러 수준 및 분기를 포함하는 것을 보여 줍니다.
context.Blogs
.Include(blog => blog.Posts).ThenInclude(post => post.Tags).ThenInclude(tag => tag.TagInfo)
.Include(blog => blog.Contributors);
적용 대상
Entity Framework
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기