Skip to content

Commit ff6af10

Browse files
committed
Feat: Remove FactoryCreatedService and PooledInjectableService APIs along with related tests and project references, streamlining dependency injection features.
1 parent db666ee commit ff6af10

File tree

17 files changed

+5
-545
lines changed

17 files changed

+5
-545
lines changed

CodeOfChaos.Extensions.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.CodeOfChaos.Extens
3232
EndProject
3333
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.CodeOfChaos.Extensions.DependencyInjection", "tests\Tests.CodeOfChaos.Extensions.DependencyInjection\Tests.CodeOfChaos.Extensions.DependencyInjection.csproj", "{A0C53C66-FFEC-42EF-A1CD-4E7396DB74FA}"
3434
EndProject
35-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.CodeOfChaos.Extensions.DependencyInjection.Generators", "tests\Tests.CodeOfChaos.Extensions.DependencyInjection.Generators\Tests.CodeOfChaos.Extensions.DependencyInjection.Generators.csproj", "{77E466A0-F307-4452-8CBC-A541FC27F4BF}"
36-
EndProject
3735
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.DependencyInjection", "src\CodeOfChaos.Extensions.DependencyInjection\CodeOfChaos.Extensions.DependencyInjection.csproj", "{9B1053FC-89D7-412D-AA24-618EFC97FDA4}"
3836
EndProject
3937
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.Extensions.DependencyInjection.Generators", "src\CodeOfChaos.Extensions.DependencyInjection.Generators\CodeOfChaos.Extensions.DependencyInjection.Generators.csproj", "{9FC9F294-BDB7-4479-B002-F0409E050A1E}"
@@ -112,10 +110,6 @@ Global
112110
{A0C53C66-FFEC-42EF-A1CD-4E7396DB74FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
113111
{A0C53C66-FFEC-42EF-A1CD-4E7396DB74FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
114112
{A0C53C66-FFEC-42EF-A1CD-4E7396DB74FA}.Release|Any CPU.Build.0 = Release|Any CPU
115-
{77E466A0-F307-4452-8CBC-A541FC27F4BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
116-
{77E466A0-F307-4452-8CBC-A541FC27F4BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
117-
{77E466A0-F307-4452-8CBC-A541FC27F4BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
118-
{77E466A0-F307-4452-8CBC-A541FC27F4BF}.Release|Any CPU.Build.0 = Release|Any CPU
119113
{9B1053FC-89D7-412D-AA24-618EFC97FDA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
120114
{9B1053FC-89D7-412D-AA24-618EFC97FDA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
121115
{9B1053FC-89D7-412D-AA24-618EFC97FDA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -177,7 +171,6 @@ Global
177171
{8670FBAC-E420-4DC6-82B1-AF0C5BF7F797} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
178172
{50072DFE-34A3-4E93-A2A1-02CDDCA66CBE} = {C632855B-76D1-4D5E-9A0A-E631B5FE71A2}
179173
{A0C53C66-FFEC-42EF-A1CD-4E7396DB74FA} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
180-
{77E466A0-F307-4452-8CBC-A541FC27F4BF} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
181174
{9B1053FC-89D7-412D-AA24-618EFC97FDA4} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
182175
{E1F41678-9171-42C9-8877-F326D878AE05} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
183176
{76717F23-6ED9-4C3B-81AD-89C79B7D36BE} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}

src/CodeOfChaos.Extensions.DependencyInjection.Generators/InjectableAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class InjectableAnalyzer : DiagnosticAnalyzer {
1818
"Service does not implement the correct Injectable service type",
1919
"The class '{0}' is not marked with injectable service type of {1}",
2020
"Injectable",
21-
DiagnosticSeverity.Warning,
21+
DiagnosticSeverity.Error,
2222
true
2323
);
2424

src/CodeOfChaos.Extensions.DependencyInjection.Generators/SourceCodes.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public static class SourceCodes {
1111
public const string InjectableSingletonAttributeMetadataName = "CodeOfChaos.Extensions.DependencyInjection.InjectableSingletonAttribute`1";
1212
public const string InjectableScopedAttributeMetadataName = "CodeOfChaos.Extensions.DependencyInjection.InjectableScopedAttribute`1";
1313
public const string InjectableTransientAttributeMetadataName = "CodeOfChaos.Extensions.DependencyInjection.InjectableTransientAttribute`1";
14-
15-
// -----------------------------------------------------------------------------------------------------------------
14+
15+
// ----------------------------------------------------------------------------------------------------------------
1616
// Methods
1717
// -----------------------------------------------------------------------------------------------------------------
1818
public static string GetInjectableGenerator(string assemblyName) => $$"""
@@ -21,7 +21,7 @@ public static string GetInjectableGenerator(string assemblyName) => $$"""
2121
using {{assemblyName}}._CodeOfChaosGenerated;
2222
namespace {{assemblyName}};
2323
public static class CodeOfChaos_InjectableRegistration {
24-
public static IServiceCollection RegisterServicesFrom{{assemblyName.Replace(".", "")}}(IServiceCollection services){
24+
public static IServiceCollection RegisterServicesFrom{{assemblyName.Replace(".", "")}}(this IServiceCollection services){
2525
InjectableUtility.RegisterServices(services);
2626
InjectableUtility.RegisterSingleton(services);
2727
InjectableUtility.RegisterScoped(services);

src/CodeOfChaos.Extensions.DependencyInjection/FactoryCreated/FactoryCreatedServiceAttribute.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/CodeOfChaos.Extensions.DependencyInjection/FactoryCreated/IFactoryService.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/CodeOfChaos.Extensions.DependencyInjection/PooledInjectableService/IPoolable.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/CodeOfChaos.Extensions.DependencyInjection/PooledInjectableService/PooledInjectableServiceAttribute.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/CodeOfChaos.Extensions.DependencyInjection/PooledInjectableService/PooledInjectedServiceObjectPolicy.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/Tests.CodeOfChaos.Extensions.DependencyInjection.Generators/Registrations/FactoryCreatedServiceRegistrationTest.cs

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)