Codewilly

Untitled

Sep 20th, 2020
864
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public static IEnumerable<int> GetRandomNumbers(int from, int to, int take)
  6. {
  7.     return Enumerable.Range(from, (to - from) + 1)
  8.                       .OrderBy(num => Guid.NewGuid())
  9.                       .Take(take);
  10. }
RAW Paste Data