File tree Expand file tree Collapse file tree
src/Examples/OpenApiNSwagClientExample Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,9 +36,9 @@ private static string WritePeople(ApiResponse<PersonCollectionResponseDocument?>
3636
3737 private static void WritePerson ( DataInPersonResponse person , ICollection < ResourceInResponse > includes , StringBuilder builder )
3838 {
39- ICollection < TodoItemIdentifierInResponse > assignedTodoItems = person . Relationships . AssignedTodoItems ? . Data ?? [ ] ;
39+ ICollection < TodoItemIdentifierInResponse > assignedTodoItems = person . Relationships ? . AssignedTodoItems ? . Data ?? [ ] ;
4040
41- builder . AppendLine ( $ " Person { person . Id } : { person . Attributes . DisplayName ?? string . Empty } with { assignedTodoItems . Count } assigned todo-items:") ;
41+ builder . AppendLine ( $ " Person { person . Id } : { person . Attributes ? . DisplayName ?? string . Empty } with { assignedTodoItems . Count } assigned todo-items:") ;
4242 WriteRelatedTodoItems ( assignedTodoItems , includes , builder ) ;
4343 }
4444
@@ -50,7 +50,7 @@ private static void WriteRelatedTodoItems(IEnumerable<TodoItemIdentifierInRespon
5050 DataInTodoItemResponse includedTodoItem = includes . OfType < DataInTodoItemResponse > ( ) . Single ( include => include . Id == todoItemIdentifier . Id ) ;
5151 ICollection < TagIdentifierInResponse > tags = includedTodoItem . Relationships ? . Tags ? . Data ?? [ ] ;
5252
53- builder . AppendLine ( $ " TodoItem { includedTodoItem . Id } : { includedTodoItem . Attributes . Description ?? string . Empty } with { tags . Count } tags:") ;
53+ builder . AppendLine ( $ " TodoItem { includedTodoItem . Id } : { includedTodoItem . Attributes ? . Description ?? string . Empty } with { tags . Count } tags:") ;
5454 WriteRelatedTags ( tags , includes , builder ) ;
5555 }
5656 }
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ private async Task SendOperationsRequestAsync(CancellationToken cancellationToke
165165
166166 ApiResponse < OperationsResponseDocument > operationsResponse = await _apiClient . PostOperationsAsync ( operationsRequest , cancellationToken ) ;
167167
168- var newTodoItem = ( DataInTodoItemResponse ) operationsResponse . Result . Atomic_results . ElementAt ( 3 ) . Data ;
168+ var newTodoItem = ( DataInTodoItemResponse ) operationsResponse . Result . Atomic_results . ElementAt ( 3 ) . Data ! ;
169169 Console . WriteLine ( $ "Created todo-item with ID { newTodoItem . Id } : { newTodoItem . Attributes ? . Description ?? string . Empty } .") ;
170170 }
171171}
You can’t perform that action at this time.
0 commit comments