Ao implementar o serviço catalogo me da um erro nullo
public class Startup { // This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddTransient<ICatalogo, Catalogo>(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IServiceProvider serviceProvider)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
ICatalogo catalogo = serviceProvider.GetService<Catalogo>();
IRelatorio relatorio = new Relatorio(catalogo);
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
await relatorio.Imprimir(context);
});
});
}
}
Como eu resolvo isso?