summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs
diff options
context:
space:
mode:
authorLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
committerLucas Faria Mendes <lucas.fariamo08@gmail.com>2026-03-30 13:38:18 +0000
commit1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 (patch)
treee1c3b20ea08f0cf71122a1e73f0d395f8fd83874 /Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs')
-rw-r--r--Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs73
1 files changed, 0 insertions, 73 deletions
diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs
deleted file mode 100644
index 15ac6ff..0000000
--- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/ControleFinanceiroRepository.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-using AutoMapper;
-using Gestor.Infrastructure.Entities.Financeiro;
-using Gestor.Infrastructure.Entities.Generic;
-using Gestor.Infrastructure.Mappers;
-using Gestor.Infrastructure.Repository.Generic;
-using Gestor.Infrastructure.Repository.Interface;
-using Gestor.Infrastructure.UnitOfWork.Generic;
-using Gestor.Model.Domain.Financeiro;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Runtime.CompilerServices;
-
-namespace Gestor.Infrastructure.Repository.Logic
-{
- public class ControleFinanceiroRepository : GenericRepository<ControleFinanceiroDb>, IControleFinanceiroRepository, IGenericRepository<ControleFinanceiroDb>
- {
- private readonly GenericUnitOfWork _unitOfWork;
-
- public ControleFinanceiroRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session)
- {
- this._unitOfWork = unitOfWork;
- }
-
- public void Delete(long id)
- {
- ControleFinanceiroDb controleFinanceiroDb = base.FindEntityById(id);
- if (controleFinanceiroDb == null)
- {
- return;
- }
- IQueryable<LancamentoDb> lancamentoDbs =
- from x in this._unitOfWork.Query<LancamentoDb>()
- where x.Controle.Id == id
- select x;
- if (lancamentoDbs.Any<LancamentoDb>())
- {
- this._unitOfWork.Repository<LancamentoDb>().DeleteRange(lancamentoDbs);
- }
- base.Delete(controleFinanceiroDb);
- }
-
- public List<ControleFinanceiro> FindByFornecedor(long id)
- {
- List<ControleFinanceiroDb> list = (
- from x in base.All()
- where x.Fornecedor.Id == id
- select x).ToList<ControleFinanceiroDb>();
- return ApplicationMapper.Mapper.Map<List<ControleFinanceiroDb>, List<ControleFinanceiro>>(list);
- }
-
- public ControleFinanceiro FindById(long id)
- {
- ControleFinanceiroDb controleFinanceiroDb = base.FindEntityById(id);
- return ApplicationMapper.Mapper.Map<ControleFinanceiroDb, ControleFinanceiro>(controleFinanceiroDb);
- }
-
- public ControleFinanceiro Merge(ControleFinanceiro controle)
- {
- ControleFinanceiroDb controleFinanceiroDb = ApplicationMapper.Mapper.Map<ControleFinanceiro, ControleFinanceiroDb>(controle);
- base.Merge(controleFinanceiroDb);
- return ApplicationMapper.Mapper.Map<ControleFinanceiroDb, ControleFinanceiro>(controleFinanceiroDb);
- }
-
- public ControleFinanceiro SaveOrUpdate(ControleFinanceiro controle)
- {
- ControleFinanceiroDb controleFinanceiroDb = ApplicationMapper.Mapper.Map<ControleFinanceiro, ControleFinanceiroDb>(controle);
- this.SaveOrUpdate(controleFinanceiroDb);
- return ApplicationMapper.Mapper.Map<ControleFinanceiroDb, ControleFinanceiro>(controleFinanceiroDb);
- }
- }
-} \ No newline at end of file