In python you can do something like this:
arr = list(set(randint(-50, 50) for _ in range(10)))
I do know how to program a extension method that fills a array, list or whatever you need with random values.
I find this cumbersome though, and I really admire how you can do it in python.
Although, I only know of Enumerable.Range,
which only can be used for generating fixed sequences, to my knowledge.
Is it possible in C# as well?