ICollection <TEntity> IRepositoryContext <TEntity> .Filter(Func <TEntity, bool> arrowFunction) { try { listEntity = ctx.Set <TEntity>().Where(arrowFunction).ToList(); } catch (Exception ex) { Dispose(true); } return(listEntity); }
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); } }