public override IEnumerable <Company> All(int maxAllowed = 10) { if (!(maxAllowed <= 0 || maxAllowed == int.MaxValue)) { var count = RepositoryDbSet.Count(); if (count > maxAllowed) { throw new ApplicationException($"Too many rows in result! {typeof(CompanyFieldOfActivity).FullName}"); } } return(RepositoryDbSet .ToList()); }