namespace Femto.Modules.Blog.Emoji; internal static partial class AllEmoji { public static IList GetRandomEmoji(int count) => new Random().TakeRandomly(Emojis).Distinct().Take(count).ToList(); } internal static class RandomExtensions { public static IEnumerable TakeRandomly(this Random rand, ICollection collection) { while (true) { var idx = rand.Next(collection.Count); yield return collection.ElementAt(idx); } } }