Hi I am trying to Migrate Web API from .Net core 2.2 to .net core 3.0 I am getting warning for the below lines code. Could you please let me know how to fix this.
public void ConfigureServices(IServiceCollection services)
{
var buildServiceProvider = services.BuildServiceProvider();
var getService = buildServiceProvider.GetService<IOptions<ConfigurationSettings>>();
ConfigurationSettings = getService.Value;
}
Warning:Calling BuildServiceProvider from application code results in additional copy of singleton services being created.
Thank you