admin/src/Oms.SqlSugarCore/System/CountryRepository.cs
zzh 8f64bbf02d
All checks were successful
Build and Deploy / deploy (push) Successful in 1m0s
feat: 国家地区支持增删改与导入,列表返回创建和更新时间
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 15:54:22 +08:00

26 lines
917 B
C#

using Fake.DependencyInjection;
using Oms.Domain.SystemAggregate.Entities;
using Oms.Domain.SystemAggregate.Repositories;
using Oms.SqlSugarCore.Repositories;
namespace Oms.SqlSugarCore.System;
public class CountryRepository : OmsSqlSugarRepository<Country>, ICountryRepository, IScopedDependency
{
public Task<Country?> GetByCountryCodeAsync(string countryCode, CancellationToken cancellationToken = default)
{
return FirstOrDefaultAsync(x => x.CountryCode == countryCode, cancellationToken);
}
public async Task<Country?> GetByCountryCodeIncludingDeletedAsync(
string countryCode,
CancellationToken cancellationToken = default)
{
var db = await GetDbContextAsync(cancellationToken);
return await SoftDeleteQuery.FirstIncludingDeletedAsync<Country>(
db,
x => x.CountryCode == countryCode,
cancellationToken);
}
}