feat: 增强仓储CRUD与种子配置

This commit is contained in:
2025-12-02 09:46:44 +08:00
parent ffc4f0885f
commit 1a01454266
16 changed files with 587 additions and 56 deletions

View File

@@ -171,4 +171,26 @@ public sealed class EfStoreRepository : IStoreRepository
{
return _context.SaveChangesAsync(cancellationToken);
}
/// <inheritdoc />
public Task UpdateStoreAsync(Store store, CancellationToken cancellationToken = default)
{
_context.Stores.Update(store);
return Task.CompletedTask;
}
/// <inheritdoc />
public async Task DeleteStoreAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
{
var existing = await _context.Stores
.Where(x => x.TenantId == tenantId && x.Id == storeId)
.FirstOrDefaultAsync(cancellationToken);
if (existing == null)
{
return;
}
_context.Stores.Remove(existing);
}
}