Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ public interface INavigationRepository<TEntity, TKey> : IRepository<TEntity, TKe
/// <param name="key">The key of entity.</param>
/// <param name="includes">Include strings.</param>
/// <returns>The entity with key equals to <paramref name="key"/>.</returns>
Task<TEntity?> GetAsync(TKey key, params string[] includes);
Task<TEntity?> GetAsync(TKey key, IEnumerable<string> includes);
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public async Task<TEnumerable> AddRangeAsync<TEnumerable>(TEnumerable entities)
}

/// <inheritdoc />
public async Task<TEntity?> GetAsync(TKey key, params string[] includes)
public async Task<TEntity?> GetAsync(TKey key, IEnumerable<string> includes)
{
return await Context.Set<TEntity>().AggregateIncludes(includes).FirstOrDefaultAsync(e => e.Id.Equals(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public async Task GetEntityAsync_StringBasedInclude_NotNullAsync()
var repository = new TestRepository(Mock.Of<IMediator>(), db);

// Act
var got = await repository.GetAsync(entity.Id, nameof(entity.Posts));
var got = await repository.GetAsync(entity.Id, new List<string>() { nameof(entity.Posts) });

// Assert
got.Should().NotBeNull();
Expand All @@ -82,7 +82,7 @@ public async Task GetEntityAsync_ThenInclude_NotNullAsync()
var repository = new TestRepository(Mock.Of<IMediator>(), db);

// Act
var got = await repository.GetAsync(entity.Id, "Posts.Tags");
var got = await repository.GetAsync(entity.Id, new List<string>() { "Posts.Tags" });

// Assert
got.Should().NotBeNull();
Expand Down