AsyncHelper.Program.getPrimesAsync C# (CSharp) Method

getPrimesAsync() public static method

public static getPrimesAsync ( int min, int count ) : Task>
min int
count int
return Task>
        public static Task<IEnumerable<int>> getPrimesAsync(int min, int count)
        {
            return Task.Run(() => Enumerable.Range(min, count).Where
             (n => Enumerable.Range(2, (int)Math.Sqrt(n) - 1).All(i =>
               n % i > 0)));
        }
    }