@@ -47,8 +47,9 @@ public virtual async Task<IReadOnlyCollection<TResource>> GetAsync(QueryLayer la
47
47
CancellationToken cancellationToken )
48
48
{
49
49
if ( layer == null ) throw new ArgumentNullException ( nameof ( layer ) ) ;
50
- var list = await ApplyQueryLayer ( layer ) . ToListAsync ( cancellationToken ) ;
51
- return list . AsReadOnly ( ) ;
50
+
51
+ var resources = await ApplyQueryLayer ( layer ) . ToListAsync ( cancellationToken ) ;
52
+ return resources . AsReadOnly ( ) ;
52
53
}
53
54
54
55
/// <inheritdoc />
@@ -146,12 +147,12 @@ public virtual async Task DeleteAsync(TId id, CancellationToken cancellationToke
146
147
147
148
if ( ! result . IsAcknowledged )
148
149
{
149
- throw new DataStoreUpdateException ( new Exception ( "Delete operation was not acknowledged by MongoDB") ) ;
150
+ throw new DataStoreUpdateException ( new Exception ( $ "Failed to delete document with id ' { id } ', because the operation was not acknowledged by MongoDB. ") ) ;
150
151
}
151
152
152
153
if ( result . DeletedCount == 0 )
153
154
{
154
- throw new DataStoreUpdateException ( new Exception ( $ "No documents were deleted. The id that was being sought was: { id } ") ) ;
155
+ throw new DataStoreUpdateException ( new Exception ( $ "Failed to delete document with id ' { id } ', because it does not exist. ") ) ;
155
156
}
156
157
}
157
158
@@ -177,7 +178,7 @@ public virtual Task RemoveFromToManyRelationshipAsync(TResource primaryResource,
177
178
}
178
179
179
180
/// <summary>
180
- /// Implements the foundational repository implementation that uses MongoDB.
181
+ /// Implements the foundational Repository layer in the JsonApiDotNetCore architecture that uses MongoDB.
181
182
/// </summary>
182
183
public class MongoDbRepository < TResource > : MongoDbRepository < TResource , string >
183
184
where TResource : class , IIdentifiable < string >
0 commit comments