4

The current docs on ASP.NET dependency injection describe an AddScoped method, which I also see as a member of IServiceCollection in Visual Studio's autocompletion when working on an ASP.NET project.

However, there are also many references on the internet (including on the MSDN blog) to an AddScope method which doesn't seem to be referenced in the official docs and doesn't show up for me in Visual Studio. Examples: 1, 2, 3. In fact, a Google search for asp.net "addscope" turns up roughly the same number of results as asp.net "addscoped"; these two names are used roughly equally often.

It would seem incredible if all of these references were just typos - surely this method name doesn't get typoed almost 50% of time consistently across the entire internet? But that makes it all the more confusing that I can't find any reference to AddScope in any official documentation. Was this a method that used to exist, or an old alias for AddScoped, or is something else going on here? What exactly is or was AddScope?

Community
  • 1
  • 1
Mark Amery
  • 143,130
  • 81
  • 406
  • 459
  • It looks like typos to me, many articles use both and quite a lot have nothing to do with IServiceCollection. – Simon May 02 '17 at 12:49
  • Example from page 2: https://www.codeproject.com/Articles/33483/Windows-Indexing-Service-Basics – Simon May 02 '17 at 12:50

0 Answers0