@@ -139,11 +139,7 @@ export class DocumentSession extends InMemoryDocumentSessionOperations
139139 options = options || { } ;
140140
141141 this . conventions . tryRegisterEntityType ( options . documentType ) ;
142- const objType = this . conventions . findEntityType ( options . documentType ) ;
143-
144- const loadOperation = new LoadOperation ( this ) ;
145- const loadInternalPromise = this . _loadInternal < TEntity > ( ids , loadOperation , null )
146- . then ( ( ) => loadOperation . getDocuments < TEntity > ( objType ) )
142+ const loadInternalPromise = this . loadInternal ( ids , options . includes , options . documentType )
147143 . then ( ( docs : EntitiesCollectionObject < TEntity > | TEntity ) => {
148144 if ( isLoadingSingle ) {
149145 return docs [ Object . keys ( docs ) [ 0 ] ] ;
@@ -157,13 +153,11 @@ export class DocumentSession extends InMemoryDocumentSessionOperations
157153 return loadInternalPromise ;
158154 }
159155
160- private async _loadInternal < T > ( //TODO: unused!
161- ids : string [ ] ,
162- operation : LoadOperation ) : Promise < void > ;
163- private async _loadInternal < T > (
156+ private async _loadInternal (
164157 ids : string [ ] ,
165- operation : LoadOperation , writable : stream . Writable ) : Promise < void > ;
166- private async _loadInternal < T > (
158+ operation : LoadOperation ,
159+ writable : stream . Writable ) : Promise < void > ;
160+ private async _loadInternal (
167161 ids : string [ ] ,
168162 operation : LoadOperation , writable ?: stream . Writable )
169163 : Promise < void > {
@@ -361,7 +355,9 @@ export class DocumentSession extends InMemoryDocumentSessionOperations
361355 }
362356
363357 public async loadInternal < TResult extends object > (
364- ids : string [ ] , includes : string [ ] , documentType : DocumentType < TResult > ) :
358+ ids : string [ ] ,
359+ includes : string [ ] ,
360+ documentType : DocumentType < TResult > ) :
365361 Promise < EntitiesCollectionObject < TResult > > {
366362 if ( ! ids ) {
367363 throwError ( "InvalidArgumentException" , "Ids cannot be null" ) ;
0 commit comments