diff --git a/src/Application/HydraScript.Application.CodeGeneration/CodeGeneratorType.cs b/src/Application/HydraScript.Application.CodeGeneration/CodeGeneratorType.cs new file mode 100644 index 0000000..eb31262 --- /dev/null +++ b/src/Application/HydraScript.Application.CodeGeneration/CodeGeneratorType.cs @@ -0,0 +1,8 @@ +namespace HydraScript.Application.CodeGeneration; + +public enum CodeGeneratorType +{ + General = 1, + + Expression = 2 +} \ No newline at end of file diff --git a/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs b/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs index b379d09..b79c4be 100644 --- a/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs +++ b/src/Application/HydraScript.Application.CodeGeneration/ServiceCollectionExtensions.cs @@ -13,10 +13,10 @@ public static IServiceCollection AddCodeGeneration(this IServiceCollection servi services.AddSingleton(); services.AddKeyedSingleton< IVisitor, - InstructionProvider>("instructions"); + InstructionProvider>(CodeGeneratorType.General); services.AddKeyedSingleton< IVisitor, - ExpressionInstructionProvider>("expression-instructions"); + ExpressionInstructionProvider>(CodeGeneratorType.Expression); return services; } } \ No newline at end of file diff --git a/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs b/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs index 9a30ebb..42f01bb 100644 --- a/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs +++ b/src/Application/HydraScript.Application.CodeGeneration/Visitors/InstructionProvider.cs @@ -29,7 +29,7 @@ internal class InstructionProvider : VisitorBase expressionVisitor) { _valueDtoConverter = valueDtoConverter; diff --git a/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs b/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs index a02152a..d895a14 100644 --- a/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs +++ b/src/Infrastructure/HydraScript.Infrastructure/CodeGenerator.cs @@ -14,7 +14,7 @@ internal class CodeGenerator : ICodeGenerator public CodeGenerator( IStaticAnalyzer staticAnalyzer, - [FromKeyedServices("instructions")] + [FromKeyedServices(CodeGeneratorType.General)] IVisitor visitor) { _staticAnalyzer = staticAnalyzer;