Files
silver-octo-spoon/wolverine/a-frame-architecture/FinancialApi.Infrastructure/Class1.cs
T
brianj bf16b7b807 Added all projects
We are almost working.
2026-07-13 17:29:43 +02:00

24 lines
601 B
C#

using FinancialApi.Application;
using Microsoft.EntityFrameworkCore;
namespace FinancialApi.Infrastructure;
public class AccountDbContext : DbContext
{
public AccountDbContext(DbContextOptions<AccountDbContext> options) : base(options)
{
}
public DbSet<Account> Accounts => Set<Account>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Account>()
.HasKey(x => x.Id);
modelBuilder.Entity<Account>().HasData(
new Account(1, 100.00m),
new Account(2, 500.00m)
);
}
}