public IList <ErrorOccurrence> GetByEnvironment(EnvironmentOccurrence environment) { try { return(_repository.GetByEnvironment(environment)); } catch (Exception e) { throw e; } }
public List <ErrorOccurrence> GetByEnvironment(EnvironmentOccurrence environment) { var result = _context.ErrorOccurrences.Where(e => e.Environment == environment); if (result.Any()) { return(result.ToList()); } throw new Exception("Não há ocorrências de erro cadastradas."); }