Skip to content

Commit 3e636b1

Browse files
CopilotPhenX
andcommitted
Fix minor code review issues: null check, redundant condition, grammar
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
1 parent d927f1f commit 3e636b1

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/PhenX.EntityFrameworkCore.BulkInsert/Graph/GraphBulkInsertOrchestrator.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,7 @@ private async Task InsertJoinEntities(
383383
{
384384
// Skip dictionary-based shared-type join entities as they are not supported
385385
// by the bulk insert infrastructure (requires typed IEnumerable<T>)
386-
if (joinEntityType == typeof(Dictionary<string, object>) ||
387-
typeof(IDictionary<string, object>).IsAssignableFrom(joinEntityType))
386+
if (typeof(IDictionary<string, object>).IsAssignableFrom(joinEntityType))
388387
{
389388
_logger?.LogWarning(
390389
"IncludeGraph: Skipping join table insertion for shared-type entity (Dictionary<string, object>). " +

src/PhenX.EntityFrameworkCore.BulkInsert/Graph/GraphEntityCollector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private static void SetInverseNavigation(object parentEntity, object childEntity
156156
// Only set inverse navigations that are reference properties (not collections).
157157
// If the inverse is a collection, the parent should be added to the collection,
158158
// not assigned directly (which would cause an invalid cast).
159-
if (navigation.Navigation is INavigation { Inverse.IsCollection: true })
159+
if (navigation.Navigation is INavigation nav && nav.Inverse?.IsCollection == true)
160160
{
161161
// Skip: inverse is a collection, not a reference property
162162
return;

tests/PhenX.EntityFrameworkCore.BulkInsert.Tests/Tests/Graph/GraphTestsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ await _context.ExecuteBulkInsertAsync(blogs, options =>
592592
[SkippableFact]
593593
public async Task InsertGraph_LargeScale()
594594
{
595-
// Arrange - Create blogs with children each (Posts, Tags, BlogSettings)
595+
// Arrange - Create blogs, each with their children (Posts, Tags, BlogSettings)
596596
// This tests correctness with a reasonable amount of data that won't cause CI timeouts
597597
const int blogCount = 50;
598598
const int postsPerBlog = 10;

0 commit comments

Comments
 (0)