Calculating a page size to execute a subset of jobs at a time
There are a few ways which this method could be made more readable.

The first if-statement is negated, making the control flow slightly more complicated; the statement can be negated (again) to clarify the flow:

private int CalculatePageSize(int totalNumberOfJobs, int deleteBatchSizeMax) 
            =&gt; totalNumberOfJobs % deleteBatchSizeMax == 0
            ?  totalNumberOfJobs / deleteBatchSizeMax
            : (totalNumberOfJobs / deleteBatchSizeMax) + 1;


Secondly, the statement is currently checking if totalNumberOfJobs is an even divisible of deleteBatchSizeMax. The computation totalNumberOfJobs / deleteBatchSizeMax is used three times. When (double)totalNumberOfJobs / (double)deleteBatchSizeMax doesn't contain a decimal place, then it implies totalNumberOfJobs % deleteBatchSizeMax == 0, and vice-versa.

To simplify the pattern, consider the following: when A divides B with no remainder, then divide it, otherwise divide it and add one. Therefore, Math.Ceiling can be used:

private int CalculatePageSize(int totalNumberOfJobs, int deleteBatchSizeMax) 
    =&gt; (int)Math.Ceiling((double)totalNumberOfJobs / (double)deleteBatchSizeMax);


The Math.Ceiling function "rounds" up to positive infinity; so 4.5 -> 5, 4.00001 -> 5 and so on. This emulates the original loop condition.

Edit: the second double conversion is not required as it is upcasted to a double.

private int CalculatePageSize(int totalNumberOfJobs, int deleteBatchSizeMax) 
    =&gt; (int)Math.Ceiling((double)totalNumberOfJobs / deleteBatchSizeMax);