Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

eager loading singleton c# dependency injection

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
    // Has message bus connection
    services.AddSingleton<ISomeRespository, SomeRepository>();

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(... ISomeRespository db)
{
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #eager #loading #singleton #dependency #injection
ADD COMMENT
Topic
Name
6+6 =