GetRequiredService without ParameterInjection or Constructor Injection

Viewed 122

I am using DotNet Core 3.1 with Balzor Serverside. From where do i need import the container. I have the following Problem, I want to access an Service from inside an Function

public static async Task<SetDataViewAction> Async(MDataView dataView)
{
  IDataViewService dataViewService = ServiceProviderServiceExtensions.GetRequiredService<IDataViewService>(How i get the Provider?);
 }

Can anyone can help me?

0 Answers
Related