Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions concepts/extension-methods/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ namespace MyExtensions
// => 2
```

Extension methods are brought into scope at the namespace level. This means that if you are in different namespace to the one the extension method is defined in, it's namespace must be in a `using` directive first; For example, if we wanted to use the above example in our code, we would first need a `using MyExtensions` directive. If you are in the same namespace as the one the extension method is defined in, you can use the extension methods without a `using` directive.
Extension methods are brought into scope at the namespace level. This means that if you are in different namespace to the one the extension method is defined in, its namespace must be in a `using` directive first; for example, if we wanted to use the above example in our code, we would first need a `using MyExtensions` directive. If you are in the same namespace as the one the extension method is defined in, you can use the extension methods without a `using` directive.

A well-known example of extension methods are the [LINQ][linq] standard query operators that add query functionality to the existing IEnumerable types. To bring these into scope we need a `using System.Linq;` directives.
A well-known example of extension methods are the [LINQ][linq] standard query operators that add query functionality to the existing IEnumerable types. To bring these into scope we need a `using System.Linq;` directive.

[linq]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/
[extension-methods]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods