Skip to content

Instantly share code, notes, and snippets.

Avatar
🙂
There is no end to self improvement...

Fatih Memis fatihmemis

🙂
There is no end to self improvement...
View GitHub Profile
@fatihmemis
fatihmemis / 000-servicelifetimes.cs
Last active Oct 20, 2021
Service lifetime samples for Asp.Net Core dependency injection.
View 000-servicelifetimes.cs
public static void Run()
{
var serviceBuilder = new ServiceCollection();
serviceBuilder
.AddSingleton<SingletonDisposableService>()
.AddTransient<TransientDisposableService>()
.AddScoped<ScopedDisposableService>()
;