Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 2
    @AfsharMohebbi the GetService which is generic is an extension method in Microsoft.Extensions.DependencyInjection namespace. Commented Nov 19, 2017 at 16:06
  • About Extension Methods: An extension method is a static method that adds funcionality to a class, you could declare public static TheReturnType TheMethodName(this TheTypeYouExtend theTypeYouExtend { // BODY} and then you could use it like: TheTypeYouExtend.TheMethodName(); That has become a very common aproach with .NET Core, so that developers can extend base functionality... good examples here: learn.microsoft.com/en-us/dotnet/csharp/programming-guide/… Commented Jun 3, 2018 at 9:44
  • 1
    [FromServices]is almost to good to be true. Pinch me! Am I dreaming? Commented Feb 14, 2023 at 7:45