There's a lot of issues in the code. If i'll try to review all of them, the post would be too long.
Give variable understandeable names. What is arrBool1 means? Write code to avoid such questions.
When you're in multithreading or asynchronous environment, avoid using global variables. This is strongly recommended. Unless ones is thread-safe or ...
DbContext is a Repository and Entity Framework uses Unit of Work pattern to wrap it, so if you need to wrap DbContext with a Repository you will need to narrow it down to more focused scope.
You'll find some arguments about wrapping a repository with another repository (e.g. using repository with EF). Generally, it's not about right or wrong, but it's about ...
While aepot answer is a good answer and got my upvote it does only work for type int. Which I know the question for an example uses int in their code but if wanting it to work for all data types will need to change the code a bit.
public static class EnumerableExtensions
public static IEnumerable<TSource> FilterRepeatingElements<TSource>(...