using System.Collections.Generic; using System.Linq; using _0_Framework.InfraStructure; using Company.Domain.FineSubjectAgg; using CompanyManagment.App.Contracts.FineSubject; using Microsoft.EntityFrameworkCore; namespace CompanyManagment.EFCore.Repository; public class FineSubjectRepository : RepositoryBase, IFineSubjectRepository { private readonly CompanyContext _companyContext; public FineSubjectRepository(CompanyContext companyContext) : base(companyContext) { _companyContext = companyContext; } public List GetAll(long workshopId) { return _companyContext.FinesSubject.Where(x => x.WorkshopId == workshopId).Select(x => new FineSubjectViewModel() { Id = x.id, Subject = x.Title, Amount = x.Amount }).ToList(); } }