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(
49
49
50
50
public virtual IQueryable < TEntity > Get ( )
51
51
{
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 ;
53
56
}
54
57
55
58
public virtual IQueryable < TEntity > Filter ( IQueryable < TEntity > entities , FilterQuery filterQuery )
@@ -85,11 +88,15 @@ public virtual async Task<TEntity> GetAsync(TId id)
85
88
86
89
public virtual async Task < TEntity > GetAndIncludeAsync ( TId id , string relationshipName )
87
90
{
91
+ _logger . LogDebug ( $ "[JADN] GetAndIncludeAsync({ id } , { relationshipName } )") ;
92
+
88
93
var result = await Get ( )
89
94
. Include ( relationshipName )
90
95
. Where ( e => e . Id . Equals ( id ) )
91
96
. ToListAsync ( ) ;
92
-
97
+
98
+ _logger . LogDebug ( $ "[JADN] Found { result . Count } entity") ;
99
+
93
100
return result . SingleOrDefault ( ) ;
94
101
}
95
102
You can’t perform that action at this time.
0 commit comments