Exemplo n.º 1
0
        ICollection <TEntity> IRepositoryContext <TEntity> .Filter(Func <TEntity, bool> arrowFunction)
        {
            try
            {
                listEntity = ctx.Set <TEntity>().Where(arrowFunction).ToList();
            }
            catch (Exception ex)
            {
                Dispose(true);
            }

            return(listEntity);
        }
Exemplo n.º 2
0
 TEntity IRepositoryContext <TEntity> .Delete(Func <TEntity, bool> predicate)
 {
     using (ctx = new DataContexto())
     {
         ctx.Set <TEntity>().Where(predicate).ToList().ForEach(d => { entity = ctx.Set <TEntity>().Remove(d); });
         ctx.SaveChanges();
         return(entity);
     }
 }