summaryrefslogtreecommitdiff
path: root/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.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/CredencialRepository.cs
parent674ca83ba9243a9e95a7568c797668dab6aee26a (diff)
downloadgestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.tar.gz
gestor-1f4e14b2e973ee7de337fd4866d9a5ceff5cb6d1.zip
chore: location
Diffstat (limited to 'Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.cs')
-rw-r--r--Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.cs75
1 files changed, 0 insertions, 75 deletions
diff --git a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.cs b/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.cs
deleted file mode 100644
index 0e7d668..0000000
--- a/Gestor.Infrastructure/Gestor.Infrastructure.Repository.Logic/CredencialRepository.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-using AutoMapper;
-using Gestor.Infrastructure.Entities.Ferramentas;
-using Gestor.Infrastructure.Mappers;
-using Gestor.Infrastructure.Repository.Generic;
-using Gestor.Infrastructure.Repository.Interface;
-using Gestor.Infrastructure.UnitOfWork.Generic;
-using Gestor.Model.Domain.Ferramentas;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Gestor.Infrastructure.Repository.Logic
-{
- public class CredencialRepository : GenericRepository<CredencialDb>, ICredencialRepository, IGenericRepository<CredencialDb>
- {
- private readonly GenericUnitOfWork _unitOfWork;
-
- public CredencialRepository(GenericUnitOfWork unitOfWork) : base(unitOfWork.Session)
- {
- this._unitOfWork = unitOfWork;
- }
-
- public void Delete(long id)
- {
- CredencialDb credencialDb = base.FindEntityById(id);
- if (credencialDb == null)
- {
- return;
- }
- credencialDb.Excluido = true;
- base.Merge(credencialDb);
- }
-
- public List<Credencial> Find(long idEmpresa)
- {
- List<CredencialDb> list = (
- from x in base.All()
- where x.IdEmpresa == idEmpresa && !x.Excluido
- select x).ToList<CredencialDb>();
- return ApplicationMapper.Mapper.Map<List<CredencialDb>, List<Credencial>>(list);
- }
-
- public List<Credencial> Find(string filter, long idEmpresa)
- {
- CredencialRepository.u003cu003ec__DisplayClass7_0 variable = null;
- IQueryable<CredencialDb> credencialDbs = base.All();
- ParameterExpression parameterExpression = Expression.Parameter(typeof(CredencialDb), "x");
- List<CredencialDb> list = credencialDbs.Where<CredencialDb>(Expression.Lambda<Func<CredencialDb, bool>>(Expression.AndAlso(Expression.Equal(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(CredencialDb).GetMethod("get_Excluido").MethodHandle)), Expression.Constant(false, typeof(bool))), Expression.OrElse(Expression.OrElse(Expression.AndAlso(Expression.Equal(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(CredencialDb).GetMethod("get_IdEmpresa").MethodHandle)), Expression.Field(Expression.Constant(variable, typeof(CredencialRepository.u003cu003ec__DisplayClass7_0)), FieldInfo.GetFieldFromHandle(typeof(CredencialRepository.u003cu003ec__DisplayClass7_0).GetField("idEmpresa").FieldHandle))), Expression.Call(Expression.Call(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(CredencialDb).GetMethod("get_Descricao").MethodHandle)), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("ToUpper").MethodHandle), Array.Empty<Expression>()), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("Contains", new Type[] { typeof(string) }).MethodHandle), new Expression[] { Expression.Field(Expression.Constant(variable, typeof(CredencialRepository.u003cu003ec__DisplayClass7_0)), FieldInfo.GetFieldFromHandle(typeof(CredencialRepository.u003cu003ec__DisplayClass7_0).GetField("filter").FieldHandle)) })), Expression.Call(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(CredencialDb).GetMethod("get_Email").MethodHandle)), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("Contains", new Type[] { typeof(string) }).MethodHandle), new Expression[] { Expression.Field(Expression.Constant(variable, typeof(CredencialRepository.u003cu003ec__DisplayClass7_0)), FieldInfo.GetFieldFromHandle(typeof(CredencialRepository.u003cu003ec__DisplayClass7_0).GetField("filter").FieldHandle)) })), Expression.Call(Expression.Property(parameterExpression, (MethodInfo)MethodBase.GetMethodFromHandle(typeof(CredencialDb).GetMethod("get_Dominio").MethodHandle)), (MethodInfo)MethodBase.GetMethodFromHandle(typeof(string).GetMethod("Contains", new Type[] { typeof(string) }).MethodHandle), new Expression[] { Expression.Field(Expression.Constant(variable, typeof(CredencialRepository.u003cu003ec__DisplayClass7_0)), FieldInfo.GetFieldFromHandle(typeof(CredencialRepository.u003cu003ec__DisplayClass7_0).GetField("filter").FieldHandle)) }))), new ParameterExpression[] { parameterExpression })).ToList<CredencialDb>();
- return ApplicationMapper.Mapper.Map<List<CredencialDb>, List<Credencial>>(list);
- }
-
- public Credencial FindById(long id)
- {
- CredencialDb credencialDb = base.FindEntityById(id);
- return ApplicationMapper.Mapper.Map<CredencialDb, Credencial>(credencialDb);
- }
-
- public Credencial Merge(Credencial credencial)
- {
- CredencialDb credencialDb = ApplicationMapper.Mapper.Map<Credencial, CredencialDb>(credencial);
- base.Merge(credencialDb);
- return ApplicationMapper.Mapper.Map<CredencialDb, Credencial>(credencialDb);
- }
-
- public Credencial SaveOrUpdate(Credencial credencial)
- {
- CredencialDb credencialDb = ApplicationMapper.Mapper.Map<Credencial, CredencialDb>(credencial);
- this.SaveOrUpdate(credencialDb);
- return ApplicationMapper.Mapper.Map<CredencialDb, Credencial>(credencialDb);
- }
- }
-} \ No newline at end of file