public void ThenTheTransientServiceReferenceIsNotTheSameAsTheSingleton() { ISingletonTestInterface singleton = result.GetService <ISingletonTestInterface>(); ITransientInterface transient = result.GetService <ITransientInterface>(); Assert.That(ReferenceEquals(singleton, transient), Is.False); }
public HomeController(ILogger <HomeController> logger, ITransientInterface transientService, IScopedInterface scopedService, ISingeletonInterface singletonService, IUpload uploadService) { _logger = logger; _transientService = transientService; _scopedService = scopedService; _singletonService = singletonService; _uploadService = uploadService; }
public Combined(ISingletonInterface first, ITransientInterface second) { if (first == null) { throw new ArgumentNullException("first"); } if (second == null) { throw new ArgumentNullException("second"); } Instances++; }
public ComputerController(IApplicationDbContext applcationDbContext, IComputerService computerService, ITransientInterface transientInterface_1, ITransientInterface transientInterface_2, IScopedInterface scopedInterface_1, IScopedInterface scopedInterface_2, ISingletonInterface singletonInterface_1, ISingletonInterface singletonInterface_2 ) { _computerService = computerService; _transientInterface_1 = transientInterface_1; _transientInterface_2 = transientInterface_2; _scopedInterface_1 = scopedInterface_1; _scopedInterface_2 = scopedInterface_2; _singletoneInterface_1 = singletonInterface_1; _singletoneInterface_2 = singletonInterface_2; }