@@ -87,7 +87,7 @@ public async Task Can_Include_Nested_HasMany_Relationships()
8787 var documents = JsonConvert . DeserializeObject < Documents > ( body ) ;
8888 var included = documents . Included ;
8989
90- Assert . Equal ( 3 , included . Count ) ; // 1 collection, 2 todos
90+ Assert . Equal ( 4 , included . Count ) ; // 1 collection, 3 todos
9191 }
9292
9393 [ Fact ]
@@ -123,7 +123,45 @@ public async Task Can_Include_Nested_HasMany_Relationships_BelongsTo()
123123 var documents = JsonConvert . DeserializeObject < Documents > ( body ) ;
124124 var included = documents . Included ;
125125
126- Assert . Equal ( 4 , included . Count ) ; // 1 collection, 2 todos, 1 owner
126+ Assert . Equal ( 5 , included . Count ) ; // 1 collection, 3 todos, 1 owner
127+ }
128+
129+ [ Fact ]
130+ public async Task Can_Include_Nested_Relationships_With_Multiple_Paths ( )
131+ {
132+ // arrange
133+ const string route = "/api/v1/todo-items?include=collection.owner.role,collection.todo-items.owner" ;
134+
135+ var todoItem = new TodoItem {
136+ Collection = new TodoItemCollection {
137+ Owner = new Person {
138+ Role = new PersonRole ( )
139+ } ,
140+ TodoItems = new List < TodoItem > {
141+ new TodoItem {
142+ Owner = new Person ( )
143+ } ,
144+ new TodoItem ( )
145+ }
146+ }
147+ } ;
148+
149+ var context = _fixture . GetService < AppDbContext > ( ) ;
150+ context . TodoItems . RemoveRange ( context . TodoItems ) ;
151+ context . TodoItems . Add ( todoItem ) ;
152+ await context . SaveChangesAsync ( ) ;
153+
154+ // act
155+ var response = await _fixture . Client . GetAsync ( route ) ;
156+
157+ // assert
158+ Assert . Equal ( HttpStatusCode . OK , response . StatusCode ) ;
159+
160+ var body = await response . Content . ReadAsStringAsync ( ) ;
161+ var documents = JsonConvert . DeserializeObject < Documents > ( body ) ;
162+ var included = documents . Included ;
163+
164+ Assert . Equal ( 7 , included . Count ) ; // 1 collection, 3 todos, 2 owners, 1 role
127165 }
128166 }
129167}
0 commit comments