refactor(giving): use AnyAsync in category seed (code-review minor)

This commit is contained in:
Chris Chen
2026-05-28 16:21:32 -07:00
parent e20964ae0d
commit 577ae1aabe
+2 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using ROLAC.API.Entities; using ROLAC.API.Entities;
namespace ROLAC.API.Data; namespace ROLAC.API.Data;
@@ -50,7 +51,7 @@ public static class DbSeeder
{ {
foreach (var (en, zh, sort) in GivingCategorySeed) foreach (var (en, zh, sort) in GivingCategorySeed)
{ {
if (!db.GivingCategories.Any(c => c.Name_en == en)) if (!await db.GivingCategories.AnyAsync(c => c.Name_en == en))
{ {
db.GivingCategories.Add(new GivingCategory db.GivingCategories.Add(new GivingCategory
{ {