Die Methode Microsoft.Framework.DependencyInjection.ServiceCollection.AddScoped in C# ermöglicht das Hinzufügen eines dienstabhängigen Objekts zur IServiceCollection. Dies bedeutet, dass ein neues Objekt für jeden Aufruf einer Dienst-Anforderung erstellt und im Rahmen der Bereitstellung als Singleton verwaltet wird. Dies ist nützlich, wenn Sie möchten, dass eine Dienstinstanz während des gesamten Lebenszyklus eines Anwendungsanbieters für jede einzelne Anforderung verfügbar ist.
C# (CSharp) Microsoft.Framework.DependencyInjection ServiceCollection.AddScoped - 25 Beispiele gefunden. Dies sind die am besten bewerteten C# (CSharp) Beispiele für die Microsoft.Framework.DependencyInjection.ServiceCollection.AddScoped, die aus Open Source-Projekten extrahiert wurden. Sie können Beispiele bewerten, um die Qualität der Beispiele zu verbessern.