All checks were successful
Build and Deploy / deploy (push) Successful in 1m0s
Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
917 B
C#
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);
|
|
}
|
|
}
|