The non-generic method ‘IServiceProvider.GetService(Type)’ cannot be used with type arguments
The generic GetService< T> method is an extension method. This means you need to have a : using Microsoft.Extensions.DependencyInjection; to allow the compiler to find it. This method is only meant for optional services. It will return null if the object can’t be constructed, either because the type wasn’t registered or because some of its … Read more