I'm trying to use Microsoft Graph in one of my controllers, however I keep running into an error everywhere I call that controller:
Unable to resolve service for type 'Microsoft.Graph.GraphServiceClient' while attempting to activate 'HomeController'.
I'm not sure why this happens, this is how I initialize the controller
private readonly Microsoft.Graph.GraphServiceClient graphServiceClient;
public HomeController(Microsoft.Graph.GraphServiceClient graphServiceClient)
{
this.graphServiceClient = graphServiceClient ?? throw new ArgumentNullException(nameof(graphServiceClient));
}