Files
Backend-Api/CompanyManagment.EFCore/Repository/PaymentInstrumentGroupRepository.cs
2025-08-05 16:05:17 +03:30

31 lines
981 B
C#

using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.PaymentInstrumentAgg;
using CompanyManagment.App.Contracts.PaymentInstrument;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class PaymentInstrumentGroupRepository : RepositoryBase<long, PaymentInstrumentGroup>,
IPaymentInstrumentGroupRepository
{
private readonly CompanyContext _context;
public PaymentInstrumentGroupRepository(CompanyContext context) : base(context)
{
_context = context;
}
public async Task<List<PaymentInstrumentGroupsViewModel>> GetList()
{
return await _context.PaymentInstrumentGroups.Where(x=>x.IsActive == IsActive.True).AsNoTracking()
.Select(x => new PaymentInstrumentGroupsViewModel()
{
Name = x.Name,
Id = x.id
}).ToListAsync();
}
}