From 1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1 Mon Sep 17 00:00:00 2001 From: Lucas Faria Mendes Date: Mon, 30 Mar 2026 10:38:18 -0300 Subject: chore: location --- .../RamoRepository.cs | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/RamoRepository.cs (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/RamoRepository.cs') diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/RamoRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/RamoRepository.cs deleted file mode 100644 index 563c6bf..0000000 --- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/RamoRepository.cs +++ /dev/null @@ -1,85 +0,0 @@ -using AutoMapper; -using Gestor.Infrastructure.Entities.Generic; -using Gestor.Infrastructure.Entities.Seguros; -using Gestor.Infrastructure.Mappers; -using Gestor.Infrastructure.Repository.Generic; -using Gestor.Infrastructure.Repository.Interface; -using Gestor.Infrastructure.UnitOfWork.Generic; -using Gestor.Model.Domain.Seguros; -using NHibernate; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.CompilerServices; - -namespace Gestor.Infrastructure.Repository.Logic -{ - public class RamoRepository : GenericRepository, IRamoRepository, IGenericRepository - { - private readonly GenericUnitOfWork _unitOfWork; - - public RamoRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session) - { - this._unitOfWork = unitOfWork; - } - - public void Delete(long id) - { - base.Delete(base.FindEntityById(id)); - } - - public List Find(bool ativo) - { - return ( - from x in this._unitOfWork.Session.CreateQuery("from RamoDb \r\n where ativo IS NULL OR ativo != '1'").List() - select new Ramo() - { - Id = x.Id, - Nome = x.Nome, - Iof = x.Iof, - Ativo = x.Ativo - }).ToList(); - } - - public List Find() - { - return ( - from x in this._unitOfWork.Session.CreateQuery("from RamoDb").List() - select new Ramo() - { - Id = x.Id, - Nome = x.Nome, - Iof = x.Iof, - Ativo = x.Ativo - }).ToList(); - } - - public Ramo FindById(long id) - { - RamoDb ramoDb = base.FindEntityById(id); - return ApplicationMapper.Mapper.Map(ramoDb); - } - - public Ramo Merge(Ramo ramo) - { - RamoDb ramoDb = ApplicationMapper.Mapper.Map(ramo); - base.Merge(ramoDb); - return ApplicationMapper.Mapper.Map(ramoDb); - } - - public List MergeRange(List ramos) - { - List ramoDbs = ApplicationMapper.Mapper.Map, List>(ramos); - RamoRepository ramoRepository = this; - ramoDbs.ForEach(new Action(ramoRepository.Merge)); - return ApplicationMapper.Mapper.Map, List>(ramoDbs); - } - - public Ramo SaveOrUpdate(Ramo ramo) - { - RamoDb ramoDb = ApplicationMapper.Mapper.Map(ramo); - this.SaveOrUpdate(ramoDb); - return ApplicationMapper.Mapper.Map(ramoDb); - } - } -} \ No newline at end of file -- cgit v1.2.3