File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/JsonApiDotNetCore/Data Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,10 @@ public DefaultEntityRepository(
4949
5050 public virtual IQueryable < TEntity > Get ( )
5151 {
52- return _dbSet . Select ( _jsonApiContext . QuerySet ? . Fields ) ;
52+ if ( _jsonApiContext . QuerySet ? . Fields != null && _jsonApiContext . QuerySet . Fields . Any ( ) )
53+ return _dbSet . Select ( _jsonApiContext . QuerySet ? . Fields ) ;
54+
55+ return _dbSet ;
5356 }
5457
5558 public virtual IQueryable < TEntity > Filter ( IQueryable < TEntity > entities , FilterQuery filterQuery )
@@ -85,11 +88,15 @@ public virtual async Task<TEntity> GetAsync(TId id)
8588
8689 public virtual async Task < TEntity > GetAndIncludeAsync ( TId id , string relationshipName )
8790 {
91+ _logger . LogDebug ( $ "[JADN] GetAndIncludeAsync({ id } , { relationshipName } )") ;
92+
8893 var result = await Get ( )
8994 . Include ( relationshipName )
9095 . Where ( e => e . Id . Equals ( id ) )
9196 . ToListAsync ( ) ;
92-
97+
98+ _logger . LogDebug ( $ "[JADN] Found { result . Count } entity") ;
99+
93100 return result . SingleOrDefault ( ) ;
94101 }
95102
You can’t perform that action at this time.
0 commit comments