diff --git a/readme.md b/readme.md index eb1f63b..6369b58 100644 --- a/readme.md +++ b/readme.md @@ -270,20 +270,6 @@ parameters), you can annotate it with `[ImportingConstructor]` from either NuGet or .NET MEF ([System.ComponentModel.Composition](https://www.nuget.org/packages/System.ComponentModel.Composition)). -### Customize Generated Class - -You can customize the generated class namespace and name with the following -MSBuild properties: - -```xml - - MyNamespace - MyExtensions - -``` - -They default to `Microsoft.Extensions.DependencyInjection` and `AddServicesExtension` -respectively. # Sponsors diff --git a/src/CodeAnalysis.Tests/AddServicesAnalyzerTests.cs b/src/CodeAnalysis.Tests/AddServicesAnalyzerTests.cs index eed2ae3..f08c313 100644 --- a/src/CodeAnalysis.Tests/AddServicesAnalyzerTests.cs +++ b/src/CodeAnalysis.Tests/AddServicesAnalyzerTests.cs @@ -43,7 +43,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, @@ -89,7 +89,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, @@ -130,7 +130,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, @@ -177,7 +177,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, diff --git a/src/CodeAnalysis.Tests/ConventionAnalyzerTests.cs b/src/CodeAnalysis.Tests/ConventionAnalyzerTests.cs index 9ba1542..7851174 100644 --- a/src/CodeAnalysis.Tests/ConventionAnalyzerTests.cs +++ b/src/CodeAnalysis.Tests/ConventionAnalyzerTests.cs @@ -42,7 +42,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, @@ -86,7 +86,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, @@ -133,7 +133,7 @@ public static void Main() { Sources = { - ThisAssembly.Resources.AttributedServicesExtension.Text, + ThisAssembly.Resources.AddServicesNoReflectionExtension.Text, ThisAssembly.Resources.ServiceAttribute.Text, ThisAssembly.Resources.ServiceAttribute_1.Text, }, diff --git a/src/DependencyInjection.Tests/ContentFiles.targets b/src/DependencyInjection.Tests/ContentFiles.targets index d70c61a..38a6ed9 100644 --- a/src/DependencyInjection.Tests/ContentFiles.targets +++ b/src/DependencyInjection.Tests/ContentFiles.targets @@ -2,13 +2,13 @@ - + - + diff --git a/src/DependencyInjection/AttributedServicesExtension.cs b/src/DependencyInjection/AddServicesNoReflectionExtension.cs similarity index 99% rename from src/DependencyInjection/AttributedServicesExtension.cs rename to src/DependencyInjection/AddServicesNoReflectionExtension.cs index 99fc7e8..49351fb 100644 --- a/src/DependencyInjection/AttributedServicesExtension.cs +++ b/src/DependencyInjection/AddServicesNoReflectionExtension.cs @@ -8,7 +8,7 @@ namespace Microsoft.Extensions.DependencyInjection /// compile-time discovered services to an . /// [EditorBrowsable(EditorBrowsableState.Never)] - static partial class AttributedServicesExtension + static partial class AddServicesNoReflectionExtension { static readonly ServiceDescriptor servicesAddedDescriptor = new ServiceDescriptor(typeof(DDIAddServicesAttribute), _ => new DDIAddServicesAttribute(), ServiceLifetime.Singleton); diff --git a/src/DependencyInjection/DependencyInjection.csproj b/src/DependencyInjection/DependencyInjection.csproj index e491933..32bd900 100644 --- a/src/DependencyInjection/DependencyInjection.csproj +++ b/src/DependencyInjection/DependencyInjection.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/DependencyInjection/IncrementalGenerator.cs b/src/DependencyInjection/IncrementalGenerator.cs index 659b9d1..4b8f0ad 100644 --- a/src/DependencyInjection/IncrementalGenerator.cs +++ b/src/DependencyInjection/IncrementalGenerator.cs @@ -263,7 +263,7 @@ void AddPartial(string methodName, SourceProductionContext ctx, (ImmutableArray< namespace Microsoft.Extensions.DependencyInjection { - static partial class AttributedServicesExtension + static partial class AddServicesNoReflectionExtension { static partial void {{methodName}}Services(IServiceCollection services) {