# DbInitializer

- File ID: file:136c3oe:dbinitializer-cs
- Path: NexusReader.Data/Persistence/DbInitializer.cs
- Role: bootstrap
- Layer: data

## Purpose

Database seeder that runs at application startup to ensure initial data (subscription plans, roles, admin user, sample author and ebook) exist in the AppDbContext.

## Key Details

Runs inside a DI scope, creates/uses AppDbContext via IDbContextFactory, performs multiple conditional seeds with SaveChangesAsync calls and top-level exception logging; intended to be executed at app startup to ensure minimal required data exists.

## Symbols

- DbInitializer: Database seeder that runs at application startup to ensure initial data (subscription plans, roles, admin user, sample author and ebook) exist in the AppDbContext.
- SeedAsync(): Create a scoped DbContext and seed initial database data: subscription plans, roles, an admin user (with role), a sample author and an ebook, with logging and error handling.

## Dependencies

- imports NexusReader.Domain/Entities/SubscriptionPlan.cs
- imports NexusReader.Domain/Entities/NexusUser.cs
- imports NexusReader.Domain/Entities/Author.cs
- imports NexusReader.Domain/Entities/Ebook.cs
- imports NexusReader.Data/Persistence/AppDbContext.cs

## Calls

- No resolved calls.

## Unresolved References

- call-target: NexusReader.Domain/Entities/SubscriptionPlan.cs
- call-target: NexusReader.Domain/Entities/NexusUser.cs
- call-target: NexusReader.Domain/Entities/Author.cs
- call-target: NexusReader.Domain/Entities/Ebook.cs
- interaction-target: dbContext.Roles.Add(new IdentityRole { Name = roleName, NormalizedName = roleName.ToUpper() });
- interaction-target: dbContext.Users.Add(adminUser);
- interaction-target: dbContext.UserRoles.Add(new IdentityUserRole<string> { UserId = adminUser.Id, RoleId = adminRole.Id });
- interaction-target: dbContext.Authors.Add(author);
- interaction-target: dbContext.Ebooks.Add(new Ebook
- interaction-target: await dbContextFactory.CreateDbContextAsync() — obtains AppDbContext for persistence operations

## Coverage

- Symbols: 2
- Executable symbols: 1
- Executable symbols with control flow: 1
- Grounded edges: 7
- Unresolved references: 10
- Control-flow fragments: 1
- Unresolved jumps: 4
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 3

## Control Flow Fragments

- SeedAsync: 72 nodes, 81 edges, 4 jumps, 0 unsupported constructs

## Diagrams

### DbInitializer Neighborhood

```mermaid
flowchart LR
    class_1t4ptj6_dbinitializer("DbInitializer")
    file_136c3oe_dbinitializer_cs("DbInitializer")
    method_n19kbi_seedasync[["SeedAsync()"]]
    file_1b03oou_subscriptionplan_cs[/"SubscriptionPlan"/]
    file_1pacvtg_appdbcontext_cs[/"AppDbContext"/]
    file_1y56eud_author_cs[/"Author"/]
    file_lcvwj6_ebook_cs[/"Ebook"/]
    file_xcxh5w_nexususer_cs[/"NexusUser"/]
    file_136c3oe_dbinitializer_cs -->|SubscriptionPlan| file_1b03oou_subscriptionplan_cs
    file_136c3oe_dbinitializer_cs -->|AppDbContext| file_1pacvtg_appdbcontext_cs
    file_136c3oe_dbinitializer_cs -->|Author| file_1y56eud_author_cs
    file_136c3oe_dbinitializer_cs -->|Ebook| file_lcvwj6_ebook_cs
    file_136c3oe_dbinitializer_cs -->|NexusUser| file_xcxh5w_nexususer_cs
```

### DbInitializer Execution Overview

```mermaid
flowchart TD
    class_1t4ptj6_dbinitializer("DbInitializer")
    method_n19kbi_seedasync[["SeedAsync()"]]
    unresolved_unresolved_148q98d_call_target{"Unresolved: FreeId / FreeName / ProId / ProName / EnterpriseId / EnterpriseName (static properties)"}
    unresolved_unresolved_17a2h42_interaction_target{"Unresolved: dbContext.Roles.Add(new IdentityRole { Name = roleName, NormalizedName = roleName.ToUpper() });"}
    unresolved_unresolved_30rgkl_interaction_target{"Unresolved: await dbContextFactory.CreateDbContextAsync() — obtains AppDbContext for persistence operations"}
    unresolved_unresolved_8fs4dr_call_target{"Unresolved: Ebook .ctor (entity creation)"}
    unresolved_unresolved_d456c0_interaction_target{"Unresolved: dbContext.Users.Add(adminUser);"}
    unresolved_unresolved_sdjm8i_interaction_target{"Unresolved: dbContext.UserRoles.Add(new IdentityUserRole<string> { UserId = adminUser.Id, RoleId = adminRole.Id });"}
    unresolved_unresolved_t3ot5v_call_target{"Unresolved: Author .ctor (entity creation)"}
    unresolved_unresolved_uowqml_interaction_target{"Unresolved: dbContext.Ebooks.Add(new Ebook"}
    unresolved_unresolved_v6805b_call_target{"Unresolved: NexusUser .ctor (entity creation)"}
    unresolved_unresolved_w7mczj_interaction_target{"Unresolved: dbContext.Authors.Add(author);"}
    class_1t4ptj6_dbinitializer -->|contains| method_n19kbi_seedasync
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_17a2h42_interaction_target
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_30rgkl_interaction_target
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_d456c0_interaction_target
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_sdjm8i_interaction_target
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_uowqml_interaction_target
    class_1t4ptj6_dbinitializer -->|unresolved interaction| unresolved_unresolved_w7mczj_interaction_target
    method_n19kbi_seedasync -->|unresolved call| unresolved_unresolved_148q98d_call_target
    method_n19kbi_seedasync -->|unresolved call| unresolved_unresolved_8fs4dr_call_target
    method_n19kbi_seedasync -->|unresolved call| unresolved_unresolved_t3ot5v_call_target
    method_n19kbi_seedasync -->|unresolved call| unresolved_unresolved_v6805b_call_target
```

### SeedAsync() Control Flow

_Warnings: diagram method_n19kbi_seedasync__fragment_diagram exceeds preferred complexity thresholds (72 nodes, 81 edges)._

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    method_n19kbi_seedasync__call_30_FreeId_FreeName_ProId_ProName_EnterpriseId_EnterpriseName_static_properties_[["FreeId / FreeName / ProId / ProName / EnterpriseId / EnterpriseName (static properties)"]]
    method_n19kbi_seedasync__call_58_NexusUser_ctor_entity_creation_[["NexusUser .ctor (entity creation)"]]
    method_n19kbi_seedasync__call_86_Author_ctor_entity_creation_[["Author .ctor (entity creation)"]]
    method_n19kbi_seedasync__call_94_Ebook_ctor_entity_creation_[["Ebook .ctor (entity creation)"]]
    method_n19kbi_seedasync__action_105_seedasync_await_105_21__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__condition{"Falls back to alternate path"}
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__false("otherwise")
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__merge("merge")
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__true("fallback")
    method_n19kbi_seedasync__action_114_error_handling_114__linear("Top-level seeding exception catch")
    method_n19kbi_seedasync__action_114_seedasync_catch_114_23__catch("catch Exception ex")
    method_n19kbi_seedasync__action_16_resource_acquire_16__linear("Create service scope and resolve services")
    method_n19kbi_seedasync__action_19_seedasync_await_19_0__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_21_seedasync_try_21_1__try("Begins protected execution")
    method_n19kbi_seedasync__action_23_log_23__linear("Starting seeding")
    method_n19kbi_seedasync__action_26_guard_clause_26__condition{"!dbContext.SubscriptionPlans.Any()"}
    method_n19kbi_seedasync__action_26_guard_clause_26__false("skip")
    method_n19kbi_seedasync__action_26_guard_clause_26__merge("merge")
    method_n19kbi_seedasync__action_26_guard_clause_26__true("add-plans")
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__condition{"!dbContext.SubscriptionPlans.Any()"}
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__false("false")
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__merge("merge")
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__true("true")
    method_n19kbi_seedasync__action_28_persistence_write_28__linear("AddRange SubscriptionPlans")
    method_n19kbi_seedasync__action_34_seedasync_await_34_3__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_35_log_35__linear("Seed progress/info logs")
    method_n19kbi_seedasync__action_40_loop_40__loop_body[["foreach roleName in roleNames -> checks dbContext.Roles.Any(...) and adds missing IdentityRole entries; then SaveChangesAsync() (lines 40-49, 49)"]]
    method_n19kbi_seedasync__action_40_loop_40__loop_entry("Seed roles (Admin, User)")
    method_n19kbi_seedasync__action_40_loop_40__loop_exit("exit loop")
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_body[["foreach (var roleName in roleNames)"]]
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_entry("var roleName in roleNames")
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_exit("Leaves the loop when the condition no longer holds.")
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__condition{"!roleExist"}
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__false("false")
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__merge("merge")
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__true("true")
    method_n19kbi_seedasync__action_49_seedasync_await_49_7__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_54_persistence_read_54__linear("Check for existing admin user")
    method_n19kbi_seedasync__action_54_seedasync_await_54_8__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_56_branch_56__condition{"adminUser == null"}
    method_n19kbi_seedasync__action_56_branch_56__false("admin-exists")
    method_n19kbi_seedasync__action_56_branch_56__merge("merge")
    method_n19kbi_seedasync__action_56_branch_56__true("create-admin")
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__condition{"adminUser == null"}
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__false("false")
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__merge("merge")
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__true("true")
    method_n19kbi_seedasync__action_71_persistence_write_71__linear("Create admin user and save")
    method_n19kbi_seedasync__action_74_seedasync_await_74_11__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_76_persistence_write_76__linear("Assign Admin role to user")
    method_n19kbi_seedasync__action_76_seedasync_await_76_12__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_78_seedasync_await_78_14__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_83_persistence_read_write_83__linear("Ensure sample Author exists")
    method_n19kbi_seedasync__action_83_seedasync_await_83_15__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__condition{"author == null"}
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__false("false")
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__merge("merge")
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__true("true")
    method_n19kbi_seedasync__action_88_seedasync_await_88_18__await[["Waits for async work"]]
    method_n19kbi_seedasync__action_92_persistence_read_write_92__linear("Add sample Ebook for admin user")
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__condition{"!dbContext.Ebooks.Any(e => e.UserId == adminUser.Id)"}
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__false("false")
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__merge("merge")
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__true("true")
    method_n19kbi_seedasync__entry(["SeedAsync entry"])
    method_n19kbi_seedasync__action_19_external_call_19__linear("Create DbContext async")
    method_n19kbi_seedasync__action_45_seedasync_repository_write_45_6__linear[("Writes repository or persistence state")]
    method_n19kbi_seedasync__action_73_seedasync_repository_write_73_10__linear[("Writes repository or persistence state")]
    method_n19kbi_seedasync__action_77_seedasync_repository_write_77_13__linear[("Writes repository or persistence state")]
    method_n19kbi_seedasync__action_87_seedasync_repository_write_87_17__linear[("Writes repository or persistence state")]
    method_n19kbi_seedasync__action_94_seedasync_repository_write_94_20__linear[("Writes repository or persistence state")]
    method_n19kbi_seedasync__implicit_return(["return"])
    method_n19kbi_seedasync__action_105_seedasync_await_105_21__await -->|fallback| method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__condition
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__condition -->|otherwise| method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__false
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__condition -->|fallback| method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__true
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__false -->|next| method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__merge
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__merge -->|next| method_n19kbi_seedasync__action_114_error_handling_114__linear
    method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__true -->|next| method_n19kbi_seedasync__action_109_seedasync_fallback_109_22__merge
    method_n19kbi_seedasync__action_114_error_handling_114__linear -->|exception| method_n19kbi_seedasync__action_114_seedasync_catch_114_23__catch
    method_n19kbi_seedasync__action_114_seedasync_catch_114_23__catch -->|return| method_n19kbi_seedasync__implicit_return
    method_n19kbi_seedasync__action_16_resource_acquire_16__linear -->|next| method_n19kbi_seedasync__action_19_seedasync_await_19_0__await
    method_n19kbi_seedasync__action_19_external_call_19__linear -->|next| method_n19kbi_seedasync__action_21_seedasync_try_21_1__try
    method_n19kbi_seedasync__action_19_seedasync_await_19_0__await -->|next| method_n19kbi_seedasync__action_19_external_call_19__linear
    method_n19kbi_seedasync__action_21_seedasync_try_21_1__try -->|next| method_n19kbi_seedasync__action_23_log_23__linear
    method_n19kbi_seedasync__action_23_log_23__linear -->|next| method_n19kbi_seedasync__action_26_guard_clause_26__condition
    method_n19kbi_seedasync__action_26_guard_clause_26__condition -->|skip| method_n19kbi_seedasync__action_26_guard_clause_26__false
    method_n19kbi_seedasync__action_26_guard_clause_26__condition -->|add-plans| method_n19kbi_seedasync__action_26_guard_clause_26__true
    method_n19kbi_seedasync__action_26_guard_clause_26__false -->|next| method_n19kbi_seedasync__action_26_guard_clause_26__merge
    method_n19kbi_seedasync__action_26_guard_clause_26__merge -->|next| method_n19kbi_seedasync__action_26_seedasync_branch_26_2__condition
    method_n19kbi_seedasync__action_26_guard_clause_26__true -->|next| method_n19kbi_seedasync__action_26_guard_clause_26__merge
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__condition -->|false| method_n19kbi_seedasync__action_26_seedasync_branch_26_2__false
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__condition -->|true| method_n19kbi_seedasync__action_26_seedasync_branch_26_2__true
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__false -->|next| method_n19kbi_seedasync__action_26_seedasync_branch_26_2__merge
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__merge -->|next| method_n19kbi_seedasync__action_28_persistence_write_28__linear
    method_n19kbi_seedasync__action_26_seedasync_branch_26_2__true -->|next| method_n19kbi_seedasync__action_26_seedasync_branch_26_2__merge
    method_n19kbi_seedasync__action_28_persistence_write_28__linear -->|used to set Id and PlanName when creating SubscriptionPlan instances| method_n19kbi_seedasync__call_30_FreeId_FreeName_ProId_ProName_EnterpriseId_EnterpriseName_static_properties_
    method_n19kbi_seedasync__action_34_seedasync_await_34_3__await -->|next| method_n19kbi_seedasync__action_35_log_35__linear
    method_n19kbi_seedasync__action_35_log_35__linear -->|next| method_n19kbi_seedasync__action_40_loop_40__loop_entry
    method_n19kbi_seedasync__action_40_loop_40__loop_body -->|continue| method_n19kbi_seedasync__action_40_loop_40__loop_entry
    method_n19kbi_seedasync__action_40_loop_40__loop_entry -->|iterate| method_n19kbi_seedasync__action_40_loop_40__loop_body
    method_n19kbi_seedasync__action_40_loop_40__loop_entry -->|exit| method_n19kbi_seedasync__action_40_loop_40__loop_exit
    method_n19kbi_seedasync__action_40_loop_40__loop_exit -->|next| method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_entry
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_body -->|continue| method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_entry
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_entry -->|var roleName in roleNames| method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_body
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_entry -->|Leaves the loop when the condition no longer holds.| method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_exit
    method_n19kbi_seedasync__action_40_seedasync_loop_40_4__loop_exit -->|next| method_n19kbi_seedasync__action_43_seedasync_branch_43_5__condition
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__condition -->|false| method_n19kbi_seedasync__action_43_seedasync_branch_43_5__false
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__condition -->|true| method_n19kbi_seedasync__action_43_seedasync_branch_43_5__true
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__false -->|next| method_n19kbi_seedasync__action_43_seedasync_branch_43_5__merge
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__merge -->|next| method_n19kbi_seedasync__action_45_seedasync_repository_write_45_6__linear
    method_n19kbi_seedasync__action_43_seedasync_branch_43_5__true -->|next| method_n19kbi_seedasync__action_43_seedasync_branch_43_5__merge
    method_n19kbi_seedasync__action_45_seedasync_repository_write_45_6__linear -->|next| method_n19kbi_seedasync__action_49_seedasync_await_49_7__await
    method_n19kbi_seedasync__action_49_seedasync_await_49_7__await -->|next| method_n19kbi_seedasync__action_54_seedasync_await_54_8__await
    method_n19kbi_seedasync__action_54_persistence_read_54__linear -->|next| method_n19kbi_seedasync__action_56_seedasync_branch_56_9__condition
    method_n19kbi_seedasync__action_54_seedasync_await_54_8__await -->|next| method_n19kbi_seedasync__action_54_persistence_read_54__linear
    method_n19kbi_seedasync__action_56_branch_56__condition -->|admin-exists| method_n19kbi_seedasync__action_56_branch_56__false
    method_n19kbi_seedasync__action_56_branch_56__condition -->|create-admin| method_n19kbi_seedasync__action_56_branch_56__true
    method_n19kbi_seedasync__action_56_branch_56__false -->|next| method_n19kbi_seedasync__action_56_branch_56__merge
    method_n19kbi_seedasync__action_56_branch_56__merge -->|instantiates admin NexusUser with email, subscription, tokens, tenant / security stamps| method_n19kbi_seedasync__call_58_NexusUser_ctor_entity_creation_
    method_n19kbi_seedasync__action_56_branch_56__true -->|next| method_n19kbi_seedasync__action_56_branch_56__merge
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__condition -->|false| method_n19kbi_seedasync__action_56_seedasync_branch_56_9__false
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__condition -->|true| method_n19kbi_seedasync__action_56_seedasync_branch_56_9__true
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__false -->|next| method_n19kbi_seedasync__action_56_seedasync_branch_56_9__merge
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__merge -->|next| method_n19kbi_seedasync__action_56_branch_56__condition
    method_n19kbi_seedasync__action_56_seedasync_branch_56_9__true -->|next| method_n19kbi_seedasync__action_56_seedasync_branch_56_9__merge
    method_n19kbi_seedasync__action_71_persistence_write_71__linear -->|next| method_n19kbi_seedasync__action_73_seedasync_repository_write_73_10__linear
    method_n19kbi_seedasync__action_73_seedasync_repository_write_73_10__linear -->|next| method_n19kbi_seedasync__action_74_seedasync_await_74_11__await
    method_n19kbi_seedasync__action_74_seedasync_await_74_11__await -->|next| method_n19kbi_seedasync__action_76_seedasync_await_76_12__await
    method_n19kbi_seedasync__action_76_persistence_write_76__linear -->|next| method_n19kbi_seedasync__action_77_seedasync_repository_write_77_13__linear
    method_n19kbi_seedasync__action_76_seedasync_await_76_12__await -->|next| method_n19kbi_seedasync__action_76_persistence_write_76__linear
    method_n19kbi_seedasync__action_77_seedasync_repository_write_77_13__linear -->|next| method_n19kbi_seedasync__action_78_seedasync_await_78_14__await
    method_n19kbi_seedasync__action_78_seedasync_await_78_14__await -->|next| method_n19kbi_seedasync__action_83_seedasync_await_83_15__await
    method_n19kbi_seedasync__action_83_persistence_read_write_83__linear -->|next| method_n19kbi_seedasync__action_84_seedasync_branch_84_16__condition
    method_n19kbi_seedasync__action_83_seedasync_await_83_15__await -->|next| method_n19kbi_seedasync__action_83_persistence_read_write_83__linear
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__condition -->|false| method_n19kbi_seedasync__action_84_seedasync_branch_84_16__false
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__condition -->|true| method_n19kbi_seedasync__action_84_seedasync_branch_84_16__true
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__false -->|next| method_n19kbi_seedasync__action_84_seedasync_branch_84_16__merge
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__merge -->|calls| method_n19kbi_seedasync__call_86_Author_ctor_entity_creation_
    method_n19kbi_seedasync__action_84_seedasync_branch_84_16__true -->|next| method_n19kbi_seedasync__action_84_seedasync_branch_84_16__merge
    method_n19kbi_seedasync__action_87_seedasync_repository_write_87_17__linear -->|next| method_n19kbi_seedasync__action_88_seedasync_await_88_18__await
    method_n19kbi_seedasync__action_88_seedasync_await_88_18__await -->|next| method_n19kbi_seedasync__action_92_seedasync_branch_92_19__condition
    method_n19kbi_seedasync__action_92_persistence_read_write_92__linear -->|next| method_n19kbi_seedasync__action_94_seedasync_repository_write_94_20__linear
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__condition -->|false| method_n19kbi_seedasync__action_92_seedasync_branch_92_19__false
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__condition -->|true| method_n19kbi_seedasync__action_92_seedasync_branch_92_19__true
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__false -->|next| method_n19kbi_seedasync__action_92_seedasync_branch_92_19__merge
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__merge -->|next| method_n19kbi_seedasync__action_92_persistence_read_write_92__linear
    method_n19kbi_seedasync__action_92_seedasync_branch_92_19__true -->|next| method_n19kbi_seedasync__action_92_seedasync_branch_92_19__merge
    method_n19kbi_seedasync__action_94_seedasync_repository_write_94_20__linear -->|creates sample Ebook for admin user with metadata and file path| method_n19kbi_seedasync__call_94_Ebook_ctor_entity_creation_
    method_n19kbi_seedasync__call_30_FreeId_FreeName_ProId_ProName_EnterpriseId_EnterpriseName_static_properties_ -->|next| method_n19kbi_seedasync__action_34_seedasync_await_34_3__await
    method_n19kbi_seedasync__call_58_NexusUser_ctor_entity_creation_ -->|next| method_n19kbi_seedasync__action_71_persistence_write_71__linear
    method_n19kbi_seedasync__call_86_Author_ctor_entity_creation_ -->|next| method_n19kbi_seedasync__action_87_seedasync_repository_write_87_17__linear
    method_n19kbi_seedasync__call_94_Ebook_ctor_entity_creation_ -->|next| method_n19kbi_seedasync__action_105_seedasync_await_105_21__await
    method_n19kbi_seedasync__entry -->|next| method_n19kbi_seedasync__action_16_resource_acquire_16__linear
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 4 unresolved jumps.
- Warning: control-flow: diagram method_n19kbi_seedasync__fragment_diagram exceeds preferred complexity thresholds (72 nodes, 81 edges).
