© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
13 replies
alkasel#159

[ASP.NET Core 6] Performance when registering a lot of singleton as services

Hi,
Does having a lot of classes registered as singleton (_builder.Services.AddSingleton(...)) reduce web app performances?

In my .NET 6 web application I have like 4 macro-features that the user may or may not want to buy (e.g. ProductionAssistant, ForecastedMaintenance etc).
Inside every macro-feature I have like 20 entities, e.g ProductionOrder, Product, Customer etc.

As of now I'm using a single controller and a single singleton service for each macro-features. The controller receives a request and forwards it to the Singleton Service that will invoke one or more scoped services which are in charge of performing the actual query.

However, as I write down the code, I notice that controllers and singleton services classes become more and more long, making reading and modifying them a bit of a pain.

Should I instead make a service and a controller for each entity? would having like 80 singleton services and 80 controllers slow down the web application?
Thanks
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ .NET CORE 6 services
C#CC# / help
4y ago
asp.net core services initialization
C#CC# / help
4y ago
[ASP.NET Core] Apply a selfsigned certificate to asp.net core?
C#CC# / help
4y ago