Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tuannguyenssu
Created July 8, 2019 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuannguyenssu/0e85bbc292e97a26cdbd9f2d65c484e1 to your computer and use it in GitHub Desktop.
Save tuannguyenssu/0e85bbc292e97a26cdbd9f2d65c484e1 to your computer and use it in GitHub Desktop.
using System;
namespace DependencyInjectionLifeTimeTest
{
public interface ITransientService
{
Guid GetID();
}
public interface IScopedService
{
Guid GetID();
}
public interface ISingletonService
{
Guid GetID();
}
public class SomeService : ITransientService, IScopedService, ISingletonService
{
Guid id;
public SomeService()
{
id = Guid.NewGuid();
}
public Guid GetID()
{
return id;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment