-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
143 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...ts/ServiceRegistrationGeneratorTests.GenerateRegisterSingletonFactoryInvalid.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
33 changes: 33 additions & 0 deletions
33
...Snapshots/ServiceRegistrationGeneratorTests.GenerateRegisterSingletonGeneric.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// <auto-generated /> | ||
#nullable enable | ||
|
||
namespace Microsoft.Extensions.DependencyInjection | ||
{ | ||
/// <summary> | ||
/// Extension methods for discovered service registrations | ||
/// </summary> | ||
public static class DiscoveredServicesExtensions | ||
{ | ||
/// <summary> | ||
/// Adds discovered services from Test.Generator to the specified service collection | ||
/// </summary> | ||
/// <param name="serviceCollection">The service collection.</param> | ||
/// <param name="tags">The service registration tags to include.</param> | ||
/// <returns>The service collection</returns> | ||
public static global::Microsoft.Extensions.DependencyInjection.IServiceCollection AddTestGenerator(this global::Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, params string[]? tags) | ||
{ | ||
var tagSet = new global::System.Collections.Generic.HashSet<string>(tags ?? global::System.Linq.Enumerable.Empty<string>()); | ||
|
||
global::Microsoft.Extensions.DependencyInjection.Extensions.ServiceCollectionDescriptorExtensions.Replace( | ||
serviceCollection, | ||
global::Microsoft.Extensions.DependencyInjection.ServiceDescriptor.Describe( | ||
typeof(global::Injectio.Sample.IService), | ||
typeof(global::Injectio.Sample.SingletonService), | ||
global::Microsoft.Extensions.DependencyInjection.ServiceLifetime.Singleton | ||
) | ||
); | ||
|
||
return serviceCollection; | ||
} | ||
} | ||
} |