Languages

C# / .NET - 'Enumerable' does not exist in the current context error

0 points
Asked by:
Kelly
394

When I try to use Enumerable.Repeat() method, I get the following error. How can I fix this?

Error:

My code:

1 answer
3 points
Answered by:
Admin Dirask Community
4380

You forgot to import System.Linq namespace.

Your code should look like:

References

  1. Enumerable.Repeat<TResult>(TResult, Int32) Method (System.Linq) | Microsoft Docs
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join