Reformat all code as per my preferred formatting.
This commit is contained in:
@@ -14,22 +14,30 @@ public class AccountDbContext(DbContextOptions<AccountDbContext> options) : DbCo
|
||||
modelBuilder.Entity<Account>()
|
||||
.HasKey(x => x.Id);
|
||||
|
||||
modelBuilder.Entity<Account>().HasData(
|
||||
new Account(1, 10000000.00m, "Credit"),
|
||||
new Account(2, 50000000.00m, "Liability"),
|
||||
new Account(99999, 0.00m, "Revenue")
|
||||
);
|
||||
modelBuilder.Entity<Account>()
|
||||
.HasData(
|
||||
new Account(1, 10000000.00m, "Credit"),
|
||||
new Account(2, 50000000.00m, "Liability"),
|
||||
new Account(99999, 0.00m, "Revenue")
|
||||
);
|
||||
|
||||
modelBuilder.Entity<JournalEntry>(builder =>
|
||||
{
|
||||
builder.HasKey(x => x.Id);
|
||||
builder.OwnsMany(x => x.Lines, line =>
|
||||
{
|
||||
line.WithOwner().HasForeignKey("JournalEntryId");
|
||||
line.Property<int>("Id").ValueGeneratedOnAdd();
|
||||
line.HasKey("Id");
|
||||
line.Property(x => x.Type).HasConversion<string>();
|
||||
});
|
||||
});
|
||||
builder.HasKey(x => x.Id);
|
||||
builder.OwnsMany(
|
||||
x => x.Lines,
|
||||
line =>
|
||||
{
|
||||
line.WithOwner()
|
||||
.HasForeignKey("JournalEntryId");
|
||||
line.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
line.HasKey("Id");
|
||||
line.Property(x => x.Type)
|
||||
.HasConversion<string>();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user