private async Task ValidateQuantifiedOfficesAsync(IEnumerable <int> officesIds) { foreach (var officeId in officesIds) { _bookServiceValidator.CheckIfRequestedOfficesExist(await _officesDbSet.AnyAsync(o => o.Id == officeId)); } }
private void ValidateQuantifiedOffices(IEnumerable <int> officesIds) { officesIds.ForEach(officeId => _bookServiceValidator.CheckIfRequestedOfficesExist(_officesDbSet.Any(o => o.Id == officeId))); }