feat(ministry): add Ministry entity, seed (10), and read endpoint
This commit is contained in:
@@ -14,6 +14,7 @@ public class AppDbContext : IdentityDbContext<AppUser, AppRole, string>
|
||||
public DbSet<GivingCategory> GivingCategories => Set<GivingCategory>();
|
||||
public DbSet<OfferingSession> OfferingSessions => Set<OfferingSession>();
|
||||
public DbSet<Giving> Givings => Set<Giving>();
|
||||
public DbSet<Ministry> Ministries => Set<Ministry>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
@@ -142,5 +143,12 @@ public class AppDbContext : IdentityDbContext<AppUser, AppRole, string>
|
||||
entity.HasOne(e => e.OfferingSession).WithMany(s => s.Givings)
|
||||
.HasForeignKey(e => e.OfferingSessionId).OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
|
||||
// ── Ministry ─────────────────────────────────────────────────────────
|
||||
builder.Entity<Ministry>(entity =>
|
||||
{
|
||||
entity.Property(e => e.Name_en).HasMaxLength(200).IsRequired();
|
||||
entity.Property(e => e.Name_zh).HasMaxLength(200);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user