20 lines
835 B
C#
20 lines
835 B
C#
using Fake.DependencyInjection;
|
|
using Oms.Domain.OrdersAggregate.Entities;
|
|
using Oms.Domain.OrdersAggregate.Repositories;
|
|
using Oms.SqlSugarCore.Repositories;
|
|
|
|
namespace Oms.SqlSugarCore.Orders;
|
|
|
|
public class OrderTemplateRepository : OmsSqlSugarRepository<OrderTemplate>, IOrderTemplateRepository, IScopedDependency
|
|
{
|
|
public Task<OrderTemplate?> GetByTypeAndTemplateKeyAsync(string type, string templateKey, CancellationToken cancellationToken = default)
|
|
{
|
|
return FirstOrDefaultAsync(x => x.Type == type && x.TemplateKey == templateKey, cancellationToken);
|
|
}
|
|
|
|
public Task<OrderTemplate?> GetByCustomerAndNameAsync(int customerId, string name, CancellationToken cancellationToken = default)
|
|
{
|
|
return FirstOrDefaultAsync(x => x.CustomerId == customerId && x.Name == name, cancellationToken);
|
|
}
|
|
}
|