Skip to content

Commit

Permalink
test: add simple test for self-referential recursive hierarchies
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Feb 1, 2024
1 parent 21b2363 commit 5c0bbf2
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntelliTect.Coalesce.Tests.TargetClasses.TestDbContext
{
public class RecursiveHierarchy
{
public int Id { get; set; }

public string Name { get; set; }

public int? ParentId { get; set; }
public RecursiveHierarchy? Parent { get; set; }

[InverseProperty(nameof(Parent))]
public List<RecursiveHierarchy> Children { get; set; } = new();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class AppDbContext : DbContext

public DbSet<StringIdentity> StringIdentities { get; set; }

public DbSet<RecursiveHierarchy> RecursiveHierarchies { get; set; }

[InternalUse]
public DbSet<DbSetIsInternalUse> Internals { get; set; }

Expand Down
5 changes: 5 additions & 0 deletions src/test-targets/api-clients.g.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions src/test-targets/metadata.g.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions src/test-targets/models.g.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/test-targets/viewmodels.g.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c0bbf2

Please sign in to comment.